de.cau.cs.kieler.core.util
Class ForkedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.cau.cs.kieler.core.util.ForkedOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class ForkedOutputStream
extends OutputStream

An output stream that can be used to send the same output to multiple output streams.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
ForkedOutputStream(List<OutputStream> theoutputStreams)
          Creates a forked output stream that writes to all output streams in the given list.
ForkedOutputStream(OutputStream stream1, OutputStream stream2)
          Creates a forked output stream that writes to the two given output streams.
 
Method Summary
 void close()
          
 void flush()
          
 void write(int b)
          
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForkedOutputStream

public ForkedOutputStream(List<OutputStream> theoutputStreams)
Creates a forked output stream that writes to all output streams in the given list.

Parameters:
theoutputStreams - list of output streams

ForkedOutputStream

public ForkedOutputStream(OutputStream stream1,
                          OutputStream stream2)
Creates a forked output stream that writes to the two given output streams.

Parameters:
stream1 - an output stream
stream2 - an output stream
Method Detail

write

public void write(int b)
           throws IOException

Specified by:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException