Package org.apache.tools.ant.util
Class LineOrientedOutputStream
java.lang.Object
java.io.OutputStream
org.apache.tools.ant.util.LineOrientedOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
- Direct Known Subclasses:
- LineOrientedOutputStreamRedirector,- LogOutputStream
Invokes 
processLine whenever a full line has
 been written to this stream.
 Tries to be smart about line separators.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Writes all remainingvoidflush()Flush this log streamprotected voidConverts the buffer to a byte[] and sends it toprocessLineprotected voidprocessLine(byte[] line) Processes a line.protected abstract voidprocessLine(String line) Processes a line.final voidwrite(byte[] b, int off, int len) Write a block of characters to the output streamfinal voidwrite(int cc) Write the data to the buffer and flush the buffer, if a line separator is detected.Methods inherited from class java.io.OutputStreamnullOutputStream, write
- 
Constructor Details- 
LineOrientedOutputStreampublic LineOrientedOutputStream()
 
- 
- 
Method Details- 
writeWrite the data to the buffer and flush the buffer, if a line separator is detected.- Specified by:
- writein class- OutputStream
- Parameters:
- cc- data to log (byte).
- Throws:
- IOException- if there is an error.
 
- 
flushFlush this log stream- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- OutputStream
- Throws:
- IOException- if there is an error.
 
- 
processBufferConverts the buffer to a byte[] and sends it toprocessLine- Throws:
- IOException- if there is an error.
 
- 
processLineProcesses a line.- Parameters:
- line- the line to log.
- Throws:
- IOException- if there is an error.
 
- 
processLineProcesses 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. - Parameters:
- line- the line to log.
- Throws:
- IOException- if there is an error.
- Since:
- Ant 1.8.3
 
- 
closeWrites all remaining- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- OutputStream
- Throws:
- IOException- if there is an error.
 
- 
writeWrite a block of characters to the output stream- Overrides:
- writein class- OutputStream
- Parameters:
- b- the array containing the data
- off- the offset into the array where data starts
- len- the length of block
- Throws:
- IOException- if the data cannot be written into the stream.
 
 
-