org.apache.commons.io.output
Class TeeOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.io.output.ProxyOutputStream
org.apache.commons.io.output.TeeOutputStream
- public class TeeOutputStream
- extends ProxyOutputStream
Classic splitter of OutputStream. Named after the unix 'tee'
command. It allows a stream to be branched off so there
are now two streams.
- Version:
- $Id: TeeOutputStream.java,v 1.4 2003/10/13 07:04:31 rdonkin Exp $
- Author:
- Henri Yandell
Field Summary |
protected java.io.OutputStream |
branch
the second OutputStream to write to |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary |
TeeOutputStream(java.io.OutputStream out,
java.io.OutputStream branch)
Constructs a TeeOutputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
branch
protected java.io.OutputStream branch
- the second OutputStream to write to
TeeOutputStream
public TeeOutputStream(java.io.OutputStream out,
java.io.OutputStream branch)
- Constructs a TeeOutputStream.
- Parameters:
out
- the main OutputStreambranch
- the second OutputStream
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write
in class ProxyOutputStream
- Throws:
java.io.IOException
- See Also:
OutputStream.write(byte[])
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write
in class ProxyOutputStream
- Throws:
java.io.IOException
- See Also:
OutputStream.write(byte[], int, int)
write
public void write(int b)
throws java.io.IOException
- Overrides:
write
in class ProxyOutputStream
- Throws:
java.io.IOException
- See Also:
OutputStream.write(int)
flush
public void flush()
throws java.io.IOException
- Overrides:
flush
in class ProxyOutputStream
- Throws:
java.io.IOException
- See Also:
OutputStream.flush()
close
public void close()
throws java.io.IOException
- Overrides:
close
in class ProxyOutputStream
- Throws:
java.io.IOException
- See Also:
OutputStream.close()