Top Description Fields Constructors Methods
ch.qos.logback.core.testUtil

public Class TeeOutputStream

extends OutputStream
Class Inheritance
Known Direct Subclasses
ch.qos.logback.core.testUtil.XTeeOutputStream
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, .PrintStream

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

Modifier and TypeField and Description
public final ByteArrayOutputStream
pack-priv final PrintStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
write(int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.
Inherited from java.io.OutputStream:
closeflushnullOutputStreamwritewrite

Field Detail

baosback to summary
public final ByteArrayOutputStream baos
targetPSback to summary
pack-priv final PrintStream targetPS

Constructor Detail

TeeOutputStreamback to summary
public TeeOutputStream(PrintStream targetPS)

Method Detail

toByteArrayback to summary
public byte[] toByteArray()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.