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
public class ConsoleAnnotationOutputStream<T>
- extends LineTransformationOutputStream
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConsoleAnnotationOutputStream
public ConsoleAnnotationOutputStream(Writer out,
ConsoleAnnotator<? super T> ann,
T context,
Charset charset)
getConsoleAnnotator
public ConsoleAnnotator getConsoleAnnotator()
eol
protected void eol(byte[] in,
int sz)
throws IOException
- Called after we read the whole line of plain text, which is stored in
LineTransformationOutputStream.buf
.
This method performs annotations and send the result to out
.
- Specified by:
eol
in class LineTransformationOutputStream
- 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
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class LineTransformationOutputStream
- Throws:
IOException
Copyright © 2004-2013. All Rights Reserved.