public class LengthLimitedInputStream extends FilterInputStream
A wrapper over an FilterInputStream which limits the reads of data from the input
stream up to a specified length that is shorter than the actual length of the stream.
in| Constructor and Description |
|---|
LengthLimitedInputStream(InputStream inputStream,
long length) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
mark(int ignoredReadlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long numberOfBytesToSkip) |
public LengthLimitedInputStream(InputStream inputStream, long length)
public int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionpublic long skip(long numberOfBytesToSkip)
throws IOException
skip in class FilterInputStreamIOExceptionpublic int available()
throws IOException
available in class FilterInputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOExceptionpublic void mark(int ignoredReadlimit)
mark in class FilterInputStreampublic void reset()
throws IOException
reset in class FilterInputStreamIOExceptionpublic boolean markSupported()
markSupported in class FilterInputStreamCopyright © 2016–2024. All rights reserved.