ch.qos.logback.core.util
Class TeeOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by ch.qos.logback.core.util.TeeOutputStream
All Implemented Interfaces:
Closeable, Flushable

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

Constructor Summary
TeeOutputStream(PrintStream targetPS)
           
 
Method Summary
 byte[] toByteArray()
           
 String toString()
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TeeOutputStream

public TeeOutputStream(PrintStream targetPS)
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

toByteArray

public byte[] toByteArray()


Copyright © 2005-2009 QOS.ch. All Rights Reserved.