Package hudson.console
Class ConsoleAnnotationOutputStream<T>
java.lang.Object
java.io.OutputStream
hudson.console.LineTransformationOutputStream
hudson.console.ConsoleAnnotationOutputStream<T>
- Type Parameters:
T
- Context type.
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Used to convert plain text console output (as byte sequence) + embedded annotations into HTML (as char sequence),
by using
ConsoleAnnotator
.- Since:
- 1.349
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.console.LineTransformationOutputStream
LineTransformationOutputStream.Delegating
-
Constructor Summary
ConstructorDescriptionConsoleAnnotationOutputStream
(Writer out, ConsoleAnnotator<? super T> ann, T context, Charset charset) -
Method Summary
Methods inherited from class hudson.console.LineTransformationOutputStream
forceEol, trimEOL, write, write
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
ConsoleAnnotationOutputStream
public ConsoleAnnotationOutputStream(Writer out, ConsoleAnnotator<? super T> ann, T context, Charset charset)
-
-
Method Details
-
getConsoleAnnotator
-
eol
Called after we read the whole line of plain text, which is stored inLineTransformationOutputStream.buf
. This method performs annotations and send the result toout
.- Specified by:
eol
in classLineTransformationOutputStream
- Parameters:
in
- Contents of the whole line, including the EOL code like CR/LF.sz
- 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
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classLineTransformationOutputStream
- Throws:
IOException
-