public class TimedInputStream extends FilterInputStream
in
Constructor and Description |
---|
TimedInputStream(InputStream in)
Creates a
FilterInputStream
by assigning the argument in
to the field this.in so as
to remember it for later use. |
Modifier and Type | Method and Description |
---|---|
int |
read()
Reads the next byte of data from this input stream.
|
int |
read(byte[] b)
Reads up to
byte.length bytes of data from this
input stream into an array of bytes. |
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from this input stream
into an array of bytes. |
available, close, mark, markSupported, reset, skip
public TimedInputStream(InputStream in)
FilterInputStream
by assigning the argument in
to the field this.in
so as
to remember it for later use.in
- the underlying input stream, or null
if
this instance is to be created without an underlying stream.public int read() throws IOException
int
in the range
0
to 255
. If no byte is available
because the end of the stream has been reached, the value
-1
is returned. This method blocks until input data
is available, the end of the stream is detected, or an exception
is thrown.
This method
simply performs in.read()
and returns the result.read
in class FilterInputStream
-1
if the end of the
stream is reached.IOException
- if an I/O error occurs.FilterInputStream.in
public int read(byte[] b) throws IOException
byte.length
bytes of data from this
input stream into an array of bytes. This method blocks until some
input is available.
This method simply performs the call
read(b, 0, b.length)
and returns
the result. It is important that it does
not do in.read(b)
instead;
certain subclasses of FilterInputStream
depend on the implementation strategy actually
used.read
in class FilterInputStream
b
- the buffer into which the data is read.-1
if there is no more data because the end of
the stream has been reached.IOException
- if an I/O error occurs.FilterInputStream.read(byte[], int, int)
public int read(byte[] b, int off, int len) throws IOException
len
bytes of data from this input stream
into an array of bytes. This method blocks until some input is
available.
This method simply performs in.read(b, off, len)
and returns the result.read
in class FilterInputStream
b
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.-1
if there is no more data because the end of
the stream has been reached.IOException
- if an I/O error occurs.FilterInputStream.in