java.io.Closeable, java.io.Flushable, java.lang.AutoCloseablepublic class LineOrientedOutputStreamRedirector extends LineOrientedOutputStream
If the source stream doesn't end with a end of line, one will be added. This is particularly useful in combination with the OutputStreamFunneler so each funneled stream get its line.
| Constructor | Description |
|---|---|
LineOrientedOutputStreamRedirector(java.io.OutputStream stream) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Writes all remaining
|
void |
flush() |
Flush this log stream
|
protected void |
processLine(byte[] b) |
Processes a line.
|
protected void |
processLine(java.lang.String line) |
Processes a line.
|
processBuffer, write, writepublic LineOrientedOutputStreamRedirector(java.io.OutputStream stream)
protected void processLine(byte[] b)
throws java.io.IOException
LineOrientedOutputStreamThis implementations invokes the string-arg version converting the byte array using the default encoding. Subclasses are encouraged to override this method (and provide a dummy implementation of the String-arg version) so they don't interfere with the encoding of the underlying stream.
processLine in class LineOrientedOutputStreamb - the line to log.java.io.IOException - if there is an error.protected void processLine(java.lang.String line)
throws java.io.IOException
LineOrientedOutputStreamprocessLine in class LineOrientedOutputStreamline - the line to log.java.io.IOException - if there is an error.public void close()
throws java.io.IOException
LineOrientedOutputStreamclose in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class LineOrientedOutputStreamjava.io.IOException - if there is an error.public void flush()
throws java.io.IOException
LineOrientedOutputStreamflush in interface java.io.Flushableflush in class LineOrientedOutputStreamjava.io.IOException - if there is an error.