Package be.gaudry.swing.utils.console
Class MessageConsole.ConsoleOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
be.gaudry.swing.utils.console.MessageConsole.ConsoleOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
- Enclosing class:
- MessageConsole
Class to intercept output from a PrintStream and add it to a Document.
 The output can optionally be redirected to a different PrintStream. The
 text displayed in the Document can be color coded to indicate the output
 source.
- 
Field SummaryFields inherited from class java.io.ByteArrayOutputStreambuf, count
- 
Constructor SummaryConstructorsConstructorDescriptionConsoleOutputStream(Color textColor, PrintStream printStream)Specify the option text color and PrintStream
- 
Method SummaryModifier and TypeMethodDescriptionvoidflush()Override this method to intercept the output text.Methods inherited from class java.io.ByteArrayOutputStreamclose, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeToMethods inherited from class java.io.OutputStreamnullOutputStream, write
- 
Constructor Details- 
ConsoleOutputStreamSpecify the option text color and PrintStream
 
- 
- 
Method Details- 
flushpublic void flush()Override this method to intercept the output text. Each line of text output will actually involve invoking this method twice: a) for the actual text message b) for the newLine string The message will be treated differently depending on whether the line will be appended or inserted into the Document- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- OutputStream
 
 
-