com.javageeks.io
Class TeeOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--com.javageeks.io.TeeOutputStream
- public class TeeOutputStream
- extends java.io.OutputStream
Class designed to "tee" output to multiple OutputStream objects
- Version:
- 1.0
- Author:
- Ted Neward
Constructor Summary |
TeeOutputStream()
Builds a TeeOutputStream with no "captued" streams |
TeeOutputStream(java.io.OutputStream[] streams)
Builds a TeeOutputStream with the streams passed already
"captured" by the TeeOutputStream |
Method Summary |
void |
addOutputStream(java.io.OutputStream os)
Adds the OutputStream passed into the list of tee'ed streams |
void |
close()
Closes all of the OutputStreams "captured" |
void |
flush()
Calls flush() on each of the OutputStreams "captured" |
void |
write(int b)
Writes a character to each of the OutputStreams "captured" |
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 |
TeeOutputStream
public TeeOutputStream()
- Builds a TeeOutputStream with no "captued" streams
TeeOutputStream
public TeeOutputStream(java.io.OutputStream[] streams)
- Builds a TeeOutputStream with the streams passed already
"captured" by the TeeOutputStream
addOutputStream
public void addOutputStream(java.io.OutputStream os)
- Adds the OutputStream passed into the list of tee'ed streams
write
public void write(int b)
throws java.io.IOException
- Writes a character to each of the OutputStreams "captured"
- Overrides:
write
in class java.io.OutputStream
flush
public void flush()
throws java.io.IOException
- Calls flush() on each of the OutputStreams "captured"
- Overrides:
flush
in class java.io.OutputStream
close
public void close()
throws java.io.IOException
- Closes all of the OutputStreams "captured"
- Overrides:
close
in class java.io.OutputStream