- java.lang.Object
-
- java.io.OutputStream
-
- ch.qos.logback.core.testUtil.TeeOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
XTeeOutputStream
public class TeeOutputStream extends OutputStream
This stream writes its output to the target PrintStream supplied to its constructor. At the same time, all the available bytes are collected and returned by the toString() method.- Author:
- Ceki Gulcu
-
-
Field Summary
Fields Modifier and Type Field Description ByteArrayOutputStreambaos
-
Constructor Summary
Constructors Constructor Description TeeOutputStream(PrintStream targetPS)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]toByteArray()StringtoString()voidwrite(int b)-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write, write
-
-
-
-
Field Detail
-
baos
public final ByteArrayOutputStream baos
-
-
Constructor Detail
-
TeeOutputStream
public TeeOutputStream(PrintStream targetPS)
-
-
Method Detail
-
write
public void write(int b) throws IOException
- Specified by:
writein classOutputStream- Throws:
IOException
-
toByteArray
public byte[] toByteArray()
-
-