|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream org.apache.commons.io.output.ProxyOutputStream org.apache.commons.io.output.TeeOutputStream
public class TeeOutputStream
Classic splitter of OutputStream. Named after the unix 'tee' command. It allows a stream to be branched off so there are now two streams.
Field Summary | |
---|---|
protected OutputStream |
branch
the second OutputStream to write to |
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
TeeOutputStream(OutputStream out,
OutputStream branch)
Constructs a TeeOutputStream. |
Method Summary | |
---|---|
void |
close()
Closes both streams. |
void |
flush()
Flushes both streams. |
void |
write(byte[] b)
Write the bytes to both streams. |
void |
write(byte[] b,
int off,
int len)
Write the specified bytes to both streams. |
void |
write(int b)
Write a byte to both streams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OutputStream branch
Constructor Detail |
---|
public TeeOutputStream(OutputStream out, OutputStream branch)
out
- the main OutputStreambranch
- the second OutputStreamMethod Detail |
---|
public void write(byte[] b) throws IOException
write
in class ProxyOutputStream
b
- the bytes to write
IOException
- if an I/O error occurspublic void write(byte[] b, int off, int len) throws IOException
write
in class ProxyOutputStream
b
- the bytes to writeoff
- The start offsetlen
- The number of bytes to write
IOException
- if an I/O error occurspublic void write(int b) throws IOException
write
in class ProxyOutputStream
b
- the byte to write
IOException
- if an I/O error occurspublic void flush() throws IOException
flush
in interface Flushable
flush
in class ProxyOutputStream
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface Closeable
close
in class ProxyOutputStream
IOException
- if an I/O error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |