org.apache.commons.io.output
Class TeeOutputStream
java.lang.Object
   java.io.OutputStream
java.io.OutputStream
       java.io.FilterOutputStream
java.io.FilterOutputStream
           org.apache.commons.io.output.ProxyOutputStream
org.apache.commons.io.output.ProxyOutputStream
               org.apache.commons.io.output.TeeOutputStream
org.apache.commons.io.output.TeeOutputStream
- All Implemented Interfaces: 
- Closeable, Flushable
- 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 471628 2006-11-06 04:06:45Z bayard $
 
 
 
| Method Summary | 
|  void | close()Closes both streams.
 | 
|  void | flush()Flushes both streams.
 | 
|  void | write(byte[] b)
 | 
|  void | write(byte[] b,
      int off,
      int len)
 | 
|  void | write(int b)
 | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
branch
protected OutputStream branch
- the second OutputStream to write to
 
 
TeeOutputStream
public TeeOutputStream(OutputStream out,
                       OutputStream branch)
- Constructs a TeeOutputStream.
 
- Parameters:
- out- the main OutputStream
- branch- the second OutputStream
 
write
public void write(byte[] b)
           throws IOException
- 
- Overrides:
- writein class- ProxyOutputStream
 
- 
- Throws:
- IOException
- See Also:
- OutputStream.write(byte[])
 
write
public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
- 
- Overrides:
- writein class- ProxyOutputStream
 
- 
- Throws:
- IOException
- See Also:
- OutputStream.write(byte[], int, int)
 
write
public void write(int b)
           throws IOException
- 
- Overrides:
- writein class- ProxyOutputStream
 
- 
- Throws:
- IOException
- See Also:
- OutputStream.write(int)
 
flush
public void flush()
           throws IOException
- Flushes both streams.
 
- 
- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- ProxyOutputStream
 
- 
- Throws:
- IOException
- See Also:
- OutputStream.flush()
 
close
public void close()
           throws IOException
- Closes both streams.
 
- 
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- ProxyOutputStream
 
- 
- Throws:
- IOException
- See Also:
- OutputStream.close()
 
Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.