com.ibm.awb.misc
Class TeeOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--com.ibm.awb.misc.TeeOutputStream

public class TeeOutputStream
extends java.io.OutputStream

TeeOutputStream is java stream variant of "tee" command. It despatch its content to two independent stream objects.

Version:
1.00, 04 July 1996
Author:
M.Oshima

Constructor Summary
TeeOutputStream(java.io.OutputStream out1, java.io.OutputStream out2)
           
 
Method Summary
 void close()
          Closes the stream.
 void flush()
          Flushes the stream.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeeOutputStream

public TeeOutputStream(java.io.OutputStream out1,
                       java.io.OutputStream out2)
Method Detail

close

public void close()
           throws java.io.IOException
Closes the stream. This method must be called to release any resources associated with the stream.
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException - If an I/O error has occurred.

flush

public void flush()
           throws java.io.IOException
Flushes the stream. This will write any buffered output bytes.
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException - If an I/O error has occurred.

write

public void write(byte[] b)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Parameters:
b - the data to be written
Throws:
java.io.IOException - If an I/O error has occurred.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Parameters:
b - the data to be written
off - the start offset in the data
len - the number of bytes that are written
Throws:
java.io.IOException - If an I/O error has occurred.

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Parameters:
b - the byte
Throws:
java.io.IOException - If an I/O error has occurred.