org.apache.commons.io.output

Class 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 471628 2006-11-06 04:06:45Z bayard $

Field Summary
protected OutputStreambranch
the second OutputStream to write to
Constructor Summary
TeeOutputStream(OutputStream out, OutputStream branch)
Constructs a TeeOutputStream.
Method Summary
voidclose()
Closes both streams.
voidflush()
Flushes both streams.
voidwrite(byte[] b)
voidwrite(byte[] b, int off, int len)
voidwrite(int b)

Field Detail

branch

protected OutputStream branch
the second OutputStream to write to

Constructor Detail

TeeOutputStream

public TeeOutputStream(OutputStream out, OutputStream branch)
Constructs a TeeOutputStream.

Parameters: out the main OutputStream branch the second OutputStream

Method Detail

close

public void close()
Closes both streams.

See Also: java.io.OutputStream#close()

flush

public void flush()
Flushes both streams.

See Also: java.io.OutputStream#flush()

write

public void write(byte[] b)

See Also: java.io.OutputStream#write(byte[])

write

public void write(byte[] b, int off, int len)

See Also: java.io.OutputStream#write(byte[], int, int)

write

public void write(int b)

See Also: java.io.OutputStream#write(int)