public class TeeInputStream extends InputStream
| Constructor and Description |
|---|
TeeInputStream(InputStream input,
OutputStream output)
Base constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream.
|
OutputStream |
getOutputStream() |
int |
read()
Reads a single byte from this stream and returns it as an integer in the
range from 0 to 255.
|
int |
read(byte[] buf)
Equivalent to
read(buffer, 0, buffer.length). |
int |
read(byte[] buf,
int off,
int len)
Reads up to
byteCount bytes from this stream and stores them in
the byte array buffer starting at byteOffset. |
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTopublic TeeInputStream(InputStream input, OutputStream output)
input - input stream to be wrapped.output - output stream to copy any input read to.public int read(byte[] buf)
throws IOException
InputStreamread(buffer, 0, buffer.length).read in class InputStreamIOExceptionpublic int read(byte[] buf,
int off,
int len)
throws IOException
InputStreambyteCount bytes from this stream and stores them in
the byte array buffer starting at byteOffset.
Returns the number of bytes actually read or -1 if the end of the stream
has been reached.read in class InputStreamIOException - if the stream is closed or another IOException occurs.public int read()
throws IOException
InputStreamread in class InputStreamIOException - if the stream is closed or another IOException occurs.public void close()
throws IOException
InputStreamclose in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException - if an error occurs while closing this stream.public OutputStream getOutputStream()