public final class FixedLengthInputStream extends FilterInputStream
InputStream with a fixed amount of bytes available to read.
When the stream is closed the remaining bytes that have not been read are
read or skipped.in| Constructor and Description |
|---|
FixedLengthInputStream(InputStream in,
long length)
Create a new input stream with a fixed number of bytes available from
the underlying stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close()
Closing will only skip to the end of this fixed length input stream and
not call the parent's close method.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
public FixedLengthInputStream(InputStream in, long length)
in - the input stream to wraplength - fixed number of bytes available through this streampublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOException - if an I/O error occurs while closing streampublic int available()
available in class FilterInputStreampublic boolean markSupported()
markSupported in class FilterInputStreampublic void mark(int readlimit)
mark in class FilterInputStreampublic void reset()
reset in class FilterInputStreampublic 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 n)
throws IOException
skip in class FilterInputStreamIOExceptionCopyright © 2000–2025 MPXJ. All rights reserved.