Package org.apache.tools.ant.util
Class LineOrientedOutputStreamRedirector
- java.lang.Object
- 
- java.io.OutputStream
- 
- org.apache.tools.ant.util.LineOrientedOutputStream
- 
- org.apache.tools.ant.util.LineOrientedOutputStreamRedirector
 
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.AutoCloseable
 
 public class LineOrientedOutputStreamRedirector extends LineOrientedOutputStream Output stream which buffer and redirect a stream line by line.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. - Since:
- Ant 1.8.3
 
- 
- 
Constructor SummaryConstructors Constructor Description LineOrientedOutputStreamRedirector(java.io.OutputStream stream)
 - 
Method SummaryModifier and Type Method Description voidclose()Writes all remainingvoidflush()Flush this log streamprotected voidprocessLine(byte[] b)Processes a line.protected voidprocessLine(java.lang.String line)Processes a line.- 
Methods inherited from class org.apache.tools.ant.util.LineOrientedOutputStreamprocessBuffer, write, write
 
- 
 
- 
- 
- 
Method Detail- 
processLineprotected void processLine(byte[] b) throws java.io.IOExceptionDescription copied from class:LineOrientedOutputStreamProcesses a line.This 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. - Overrides:
- processLinein class- LineOrientedOutputStream
- Parameters:
- b- the line to log.
- Throws:
- java.io.IOException- if there is an error.
 
 - 
processLineprotected void processLine(java.lang.String line) throws java.io.IOExceptionDescription copied from class:LineOrientedOutputStreamProcesses a line.- Specified by:
- processLinein class- LineOrientedOutputStream
- Parameters:
- line- the line to log.
- Throws:
- java.io.IOException- if there is an error.
 
 - 
closepublic void close() throws java.io.IOExceptionDescription copied from class:LineOrientedOutputStreamWrites all remaining- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- LineOrientedOutputStream
- Throws:
- java.io.IOException- if there is an error.
 
 - 
flushpublic void flush() throws java.io.IOExceptionDescription copied from class:LineOrientedOutputStreamFlush this log stream- Specified by:
- flushin interface- java.io.Flushable
- Overrides:
- flushin class- LineOrientedOutputStream
- Throws:
- java.io.IOException- if there is an error.
 
 
- 
 
-