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:
Closeable
,Flushable
,AutoCloseable
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Writes all remainingvoid
flush()
Flush this log streamprotected void
processLine
(byte[] b) Processes a line.protected void
processLine
(String line) Processes a line.Methods inherited from class org.apache.tools.ant.util.LineOrientedOutputStream
processBuffer, write, write
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
LineOrientedOutputStreamRedirector
-
-
Method Details
-
processLine
Description copied from class:LineOrientedOutputStream
Processes 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:
processLine
in classLineOrientedOutputStream
- Parameters:
b
- the line to log.- Throws:
IOException
- if there is an error.
-
processLine
Description copied from class:LineOrientedOutputStream
Processes a line.- Specified by:
processLine
in classLineOrientedOutputStream
- Parameters:
line
- the line to log.- Throws:
IOException
- if there is an error.
-
close
Description copied from class:LineOrientedOutputStream
Writes all remaining- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classLineOrientedOutputStream
- Throws:
IOException
- if there is an error.
-
flush
Description copied from class:LineOrientedOutputStream
Flush this log stream- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classLineOrientedOutputStream
- Throws:
IOException
- if there is an error.
-