cx.ath.matthew.io

Class TeeInputStream

public class TeeInputStream extends FilterInputStream

Class to copy a stream to a file or another stream as it is being sent through a stream pipe E.g.
    Reader r = new InputStreamReader(new TeeInputStream(new FileInputStream("file"), new File("otherfile")));
 
Constructor Summary
TeeInputStream(InputStream is, OutputStream tos)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.
TeeInputStream(InputStream is, File f, boolean append)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.
TeeInputStream(InputStream is, File f)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.
TeeInputStream(InputStream is, String f, boolean append)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.
TeeInputStream(InputStream is, String f)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.
Method Summary
intavailable()
voidclose()
voidfinalize()
voidflush()
voidmark(int readlimit)
booleanmarkSupported()
intread()
intread(byte[] b)
intread(byte[] b, int off, int len)
voidreset()
longskip(long n)

Constructor Detail

TeeInputStream

public TeeInputStream(InputStream is, OutputStream tos)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.

Parameters: is Reads from this InputStream tos Write to this OutputStream

TeeInputStream

public TeeInputStream(InputStream is, File f, boolean append)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.

Parameters: is Reads from this InputStream f Write to this File append Append to file not overwrite

TeeInputStream

public TeeInputStream(InputStream is, File f)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.

Parameters: is Reads from this InputStream f Write to this File

TeeInputStream

public TeeInputStream(InputStream is, String f, boolean append)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.

Parameters: is Reads from this InputStream f Write to this File append Append to file not overwrite

TeeInputStream

public TeeInputStream(InputStream is, String f)
Create a new TeeInputStream on the given InputStream and copy the stream to the given File.

Parameters: is Reads from this InputStream f Write to this File

Method Detail

available

public int available()

close

public void close()

finalize

public void finalize()

flush

public void flush()

mark

public void mark(int readlimit)

markSupported

public boolean markSupported()

read

public int read()

read

public int read(byte[] b)

read

public int read(byte[] b, int off, int len)

reset

public void reset()

skip

public long skip(long n)