Package hudson.console
Class LineTransformationOutputStream
java.lang.Object
java.io.OutputStream
hudson.console.LineTransformationOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
ConsoleAnnotationOutputStream,LineTransformationOutputStream.Delegating
Filtering
OutputStream that buffers text by line, so that the derived class
can perform some manipulation based on the contents of the whole line.
Subclass LineTransformationOutputStream.Delegating in the typical case that you are decorating an underlying stream.
- Since:
- 1.349
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConvenience subclass for cases where you wish to process lines being sent to an underlying stream. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
LineTransformationOutputStream
public LineTransformationOutputStream()
-
-
Method Details
-
eol
Called for each end of the line.- Parameters:
b- Contents of the whole line, including the EOL code like CR/LF.len- Specifies the length of the valid contents in 'b'. The rest is garbage. This is so that the caller doesn't have to allocate an array of the exact size.- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
forceEol
Forces the EOL behavior. Useful if the caller wants to make sure the buffered content is all processed, but without actually neither flushing nor closing the stream.- Throws:
IOException
-
trimEOL
-