Package org.eclipse.ui.console
Class IOConsoleOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.ui.console.IOConsoleOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
- Direct Known Subclasses:
- MessageConsoleStream
OutputStream used to write to an IOConsole.
 
 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.
- Since:
- 3.1
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()voidflush()getColor()Returns the color of this stream, ornullif default.intReturns the font style used to decorate data written to this stream.booleanReturns whether the console this stream is writing to will be activated when this stream is written to.booleanisClosed()Returns true if the stream has been closedvoidsetActivateOnWrite(boolean activateOnWrite) Sets whether to activate the console this stream is writing to when this stream is written to.voidsetCharset(Charset charset) voidSets the color of this stream.voidsetEncoding(String encoding) Sets the character encoding used to interpret characters written to this steam.voidsetFontStyle(int newFontStyle) Sets the font style to be used to decorate data written to this stream.voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(char[] buffer) Writes a character array to the attached console.voidwrite(char[] buffer, int off, int len) Writes a character array using specified offset and length to the attached console.voidwrite(int b) voidwrite(CharSequence chars) Writes a character sequence to the attached console.voidWrites a string to the attached console.Methods inherited from class java.io.OutputStreamnullOutputStream
- 
Method Details- 
getFontStylepublic int getFontStyle()Returns the font style used to decorate data written to this stream.- Returns:
- the font style used to decorate data written to this stream
 
- 
setFontStylepublic void setFontStyle(int newFontStyle) Sets the font style to be used to decorate data written to this stream.- Parameters:
- newFontStyle- the font style to be used to decorate data written to this stream
 
- 
isActivateOnWritepublic boolean isActivateOnWrite()Returns whether the console this stream is writing to will be activated when this stream is written to.- Returns:
- whether the console this stream is writing to will be activated when this stream is written to.
 
- 
setActivateOnWritepublic void setActivateOnWrite(boolean activateOnWrite) Sets whether to activate the console this stream is writing to when this stream is written to.- Parameters:
- activateOnWrite- whether the console this stream is writing to will be activated when this stream is written to.
 
- 
setColorSets the color of this stream. Usenullto indicate the default color.- Parameters:
- newColor- color of this stream, or- null
 
- 
getColorReturns the color of this stream, ornullif default.- Returns:
- the color of this stream, or null
 
- 
isClosedpublic boolean isClosed()Returns true if the stream has been closed- Returns:
- true is the stream has been closed, false otherwise.
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- OutputStream
- Throws:
- IOException
 
- 
flush- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- OutputStream
- Throws:
- IOException
 
- 
write- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Specified by:
- writein class- OutputStream
- Throws:
- IOException
 
- 
writeWrites a character array to the attached console.- Parameters:
- buffer- the char array to write to the attached console
- Throws:
- IOException- if the stream is closed
- Since:
- 3.7
 
- 
writeWrites a character array using specified offset and length to the attached console.- Parameters:
- buffer- the char array to write to the attached console.
- off- the initial offset
- len- the length
- Throws:
- IOException- if the stream is closed
- Since:
- 3.7
 
- 
writeWrites a character sequence to the attached console.- Parameters:
- chars- the string/characters to write to the attached console.
- Throws:
- IOException- if the stream is closed.
- Since:
- 3.7
 
- 
writeWrites a string to the attached console.- Parameters:
- str- the string to write to the attached console
- Throws:
- IOException- if the stream is closed
 
- 
setEncodingSets the character encoding used to interpret characters written to this steam.- Parameters:
- encoding- encoding identifier
 
- 
setCharset- Parameters:
- charset- set the Charset for the attached console
- Throws:
- IOException- if the stream is closed
- Since:
- 3.7
 
 
-