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.InputStreamjava.io.IOExceptionpublic long skip(long cnt)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionCopyright © 2012. All Rights Reserved.