public class TeeInputStream extends InputStream
TemporaryBuffer
, where any
data read or skipped by the caller is also duplicated into the temporary
buffer. Later the temporary buffer can then be used instead of the original
source stream.
During close this stream copies any remaining data from the source stream
into the destination stream.Constructor and Description |
---|
TeeInputStream(InputStream src,
OutputStream dst)
Initialize a tee input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long count) |
available, mark, markSupported, read, reset
public TeeInputStream(InputStream src, OutputStream dst)
src
- source stream to consume.dst
- destination to copy the source to as it is consumed. Typically
this is a TemporaryBuffer
.public int read() throws IOException
read
in class InputStream
IOException
public long skip(long count) throws IOException
skip
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2013. All Rights Reserved.