cx.ath.matthew.io

Class TeeOutputStream

public class TeeOutputStream extends FilterOutputStream

Class to copy a stream to another stream or file as it is being sent through a stream pipe E.g.
    PrintWriter r = new PrintWriter(new TeeOutputStream(new FileOutputStream("file"), new File("otherfile")));
 
Constructor Summary
TeeOutputStream(OutputStream os, OutputStream tos)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the other OuputStream.
TeeOutputStream(OutputStream os, File f, boolean append)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.
TeeOutputStream(OutputStream os, File f)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.
TeeOutputStream(OutputStream os, String f, boolean append)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.
TeeOutputStream(OutputStream os, String f)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.
Method Summary
voidclose()
voidfinalize()
voidflush()
voidwrite(int b)
voidwrite(byte[] b)
voidwrite(byte[] b, int off, int len)

Constructor Detail

TeeOutputStream

public TeeOutputStream(OutputStream os, OutputStream tos)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the other OuputStream.

Parameters: os Writes to this OutputStream tos Write to this OutputStream

TeeOutputStream

public TeeOutputStream(OutputStream os, File f, boolean append)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.

Parameters: os Writes to this OutputStream f Write to this File append Append to file not overwrite

TeeOutputStream

public TeeOutputStream(OutputStream os, File f)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.

Parameters: os Writes to this OutputStream f Write to this File

TeeOutputStream

public TeeOutputStream(OutputStream os, String f, boolean append)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.

Parameters: os Writes to this OutputStream f Write to this File append Append to file not overwrite

TeeOutputStream

public TeeOutputStream(OutputStream os, String f)
Create a new TeeOutputStream on the given OutputStream and copy the stream to the given File.

Parameters: os Writes to this OutputStream f Write to this File

Method Detail

close

public void close()

finalize

public void finalize()

flush

public void flush()

write

public void write(int b)

write

public void write(byte[] b)

write

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