org.apache.commons.io.output
Class 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.
$Id: TeeOutputStream.java 610010 2008-01-08 14:50:59Z niallp $protected OutputStream | branch - the second OutputStream to write to
|
TeeOutputStream(OutputStream out, OutputStream branch) - Constructs a TeeOutputStream.
|
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.
|
branch
protected OutputStream branch
the second OutputStream to write to
TeeOutputStream
public TeeOutputStream(OutputStream out,
OutputStream branch)
Constructs a TeeOutputStream.
out
- the main OutputStreambranch
- the second OutputStream
write
public void write(byte[] b)
throws IOException
Write the bytes to both streams.
- write in interface ProxyOutputStream
write
public void write(byte[] b,
int off,
int len)
throws IOException
Write the specified bytes to both streams.
- write in interface ProxyOutputStream
b
- the bytes to writeoff
- The start offsetlen
- The number of bytes to write
write
public void write(int b)
throws IOException
Write a byte to both streams.
- write in interface ProxyOutputStream
Copyright (c) 2002-2009 Apache Software Foundation