public class TeeInputStream
extends java.io.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(java.io.InputStream src,
java.io.OutputStream dst)
Initialize a tee input stream.
|
public TeeInputStream(java.io.InputStream src, java.io.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 java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long cnt) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
Copyright © 2012. All Rights Reserved.