public class LimitedLengthInputStream extends FilterInputStream
|Constructor and Description|
|Modifier and Type||Method and Description|
Reads a single byte from the filtered stream and returns it as an integer in the range from 0 to 255.
Reads at most
available, close, mark, markSupported, reset, skip
public LimitedLengthInputStream(InputStream in, long offset, long length) throws IOException
in- underlying stream to wrap
offset- offset into stream where data starts
length- length of data at offset
IOException- if an error occurred with the underlying stream
public int read() throws IOException
public int read(byte buffer, int offset, int byteCount) throws IOException
countbytes from this stream and stores them in the byte array
offset. Returns the number of bytes actually read or -1 if no bytes have been read and the end of this stream has been reached. This implementation reads bytes from the filtered stream.
buffer- the byte array in which to store the bytes read.
offset- the initial position in
bufferto store the bytes read from this stream.
byteCount- the maximum number of bytes to store in
IOException- if this stream is closed or another I/O error occurs.