public class IOConsoleOutputStream extends OutputStream
Clients are not intended to instantiate this class directly, instead
use IOConsole.newOutputStream()
.
Clients should avoid writing large amounts of output to this stream in the UI thread. The console needs to process the output in the UI thread and if the client hogs the UI thread writing output to the console, the console will not be able to process the output.
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
Color |
getColor()
Returns the color of this stream, or
null
if default. |
int |
getFontStyle()
Returns the font style used to decorate data written to this stream.
|
boolean |
isActivateOnWrite()
Returns whether the console this stream is writing to will be activated when this stream
is written to.
|
boolean |
isClosed()
Returns true if the stream has been closed
|
void |
setActivateOnWrite(boolean activateOnWrite)
Sets whether to activate the console this stream is writing to when this stream
is written to.
|
void |
setCharset(Charset charset) |
void |
setColor(Color newColor)
Sets the color of this stream.
|
void |
setEncoding(String encoding)
Sets the character encoding used to interpret characters written to this steam.
|
void |
setFontStyle(int newFontStyle)
Sets the font style to be used to decorate data written to this stream.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(char[] buffer)
Writes a character array to the attached console.
|
void |
write(char[] buffer,
int off,
int len)
Writes a character array using specified offset and length to the
attached console.
|
void |
write(CharSequence chars)
Writes a character sequence to the attached console.
|
void |
write(int b) |
void |
write(String str)
Writes a string to the attached console.
|
public int getFontStyle()
public void setFontStyle(int newFontStyle)
newFontStyle
- the font style to be used to decorate data written to this streampublic boolean isActivateOnWrite()
public void setActivateOnWrite(boolean activateOnWrite)
activateOnWrite
- whether the console this stream is writing to will be activated when this stream
is written to.public void setColor(Color newColor)
null
to indicate
the default color.newColor
- color of this stream, or null
public Color getColor()
null
if default.null
public boolean isClosed()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(char[] buffer) throws IOException
buffer
- the char array to write to the attached consoleIOException
- if the stream is closedpublic void write(char[] buffer, int off, int len) throws IOException
buffer
- the char array to write to the attached console.off
- the initial offsetlen
- the lengthIOException
- if the stream is closedpublic void write(CharSequence chars) throws IOException
chars
- the string/characters to write to the attached console.IOException
- if the stream is closed.public void write(String str) throws IOException
str
- the string to write to the attached consoleIOException
- if the stream is closedpublic void setEncoding(String encoding)
encoding
- encoding identifierpublic void setCharset(Charset charset) throws IOException
charset
- set the Charset for the attached consoleIOException
- if the stream is closed
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.