org.abstracthorizon.mercury.common.io
Class StreamSplitter

java.lang.Object
  extended by java.io.OutputStream
      extended by org.abstracthorizon.mercury.common.io.StreamSplitter
All Implemented Interfaces:
Closeable, Flushable

public class StreamSplitter
extends OutputStream

This output stream writes out to both supplied streams at the same time.

Author:
Daniel Sendula

Field Summary
protected  OutputStream stream1
          Fist stream
protected  OutputStream stream2
          Second stream
 
Constructor Summary
StreamSplitter(OutputStream stream1, OutputStream stream2)
          Constructor
 
Method Summary
 void write(byte[] b)
           
 void write(byte[] b, int o, int l)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream1

protected OutputStream stream1
Fist stream


stream2

protected OutputStream stream2
Second stream

Constructor Detail

StreamSplitter

public StreamSplitter(OutputStream stream1,
                      OutputStream stream2)
Constructor

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

write

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

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int o,
                  int l)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.