RoboJDETM v2.0

com.ridgesoft.io
Class OutputStreamTee

java.lang.Object
  extended by java.io.OutputStream
      extended by com.ridgesoft.io.OutputStreamTee

public class OutputStreamTee
extends OutputStream

Class to tee one output stream into two output streams.

Output written to an object of this class writes through to the two underlying OutputStreams.


Constructor Summary
OutputStreamTee(OutputStream stream1, OutputStream stream2)
          Construct and output stream tee.
 
Method Summary
 void close()
          Closes this OutputStream by releasing the two underlying OutputStreams.
 void flush()
          Flushes the two streams.
 void write(byte[] b)
          Writes an array of bytes to the two streams.
 void write(byte[] b, int off, int len)
          Writes a portion of an array of bytes to the two streams.
 void write(int b)
          Writes one byte to the two streams.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

OutputStreamTee

public OutputStreamTee(OutputStream stream1,
                       OutputStream stream2)
Construct and output stream tee.

Parameters:
stream1 - first output stream
stream2 - second output stream
Method Detail

close

public void close()
           throws IOException
Closes this OutputStream by releasing the two underlying OutputStreams.

This method does not close the underlying OutputStreams.

Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Flushes the two streams.

Overrides:
flush in class OutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Writes an array of bytes to the two streams.

Overrides:
write in class OutputStream
Parameters:
b - array of bytes to write
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Writes a portion of an array of bytes to the two streams.

Overrides:
write in class OutputStream
Parameters:
b -
off -
len -
Throws:
IOException

write

public void write(int b)
           throws IOException
Writes one byte to the two streams.

Specified by:
write in class OutputStream
Parameters:
b - byte to write
Throws:
IOException

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com