public final class InflaterInputStream extends FilterInputStream
Constructor and Description |
---|
InflaterInputStream(InflaterInputStream copy)
Extra constructor added for org.eclipse.mat.hprof
Only safe to use copy or original once the underlying stream
has been positioned to the appropriate location.
|
InflaterInputStream(InputStream in,
boolean detachable)
Constructs an inflater input stream over the specified underlying input stream, and with the
specified option for detachability.
|
InflaterInputStream(InputStream in,
boolean detachable,
int inBufLen)
Constructs an inflater input stream over the specified underlying input stream, with the
specified options for detachability and input buffer size.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this input stream and the underlying stream.
|
void |
detach()
Detaches the underlying input stream from this decompressor.
|
int |
read()
Reads the next byte of decompressed data from this stream.
|
int |
read(byte[] b,
int off,
int len)
Reads some bytes from the decompressed data of this stream into the specified array's subrange.
|
available, mark, markSupported, read, reset, skip
public InflaterInputStream(InputStream in, boolean detachable)
detach()
to be called, and requires the specified input stream to support marking.in
- the underlying input stream of raw DEFLATE-compressed datadetachable
- whether detach()
can be called laterNullPointerException
- if the input stream is null
IllegalArgumentException
- if detach == true
but in.markSupported() == false
public InflaterInputStream(InputStream in, boolean detachable, int inBufLen)
detach()
to be called,
and requires the specified input stream to support marking.in
- the underlying input stream of raw DEFLATE-compressed datadetachable
- whether detach()
can be called laterinBufLen
- the size of the internal read buffer, which must be positiveNullPointerException
- if the input stream is null
IllegalArgumentException
- if inBufLen < 1
IllegalArgumentException
- if detach == true
but in.markSupported() == false
public InflaterInputStream(InflaterInputStream copy)
public int read() throws IOException
read
in class FilterInputStream
IOException
- if an I/O exception occurred in the underlying input stream, the end of
stream was encountered at an unexpected position, or the compressed data has a format errorIllegalStateException
- if the stream has already been closedpublic int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
NullPointerException
- if the array is null
ArrayIndexOutOfBoundsException
- if the array subrange is out of boundsIOException
- if an I/O exception occurred in the underlying input stream, the end of
stream was encountered at an unexpected position, or the compressed data has a format errorIllegalStateException
- if the stream has already been closedpublic void detach() throws IOException
detach()
invalidates this stream object but doesn't close the underlying stream.
This method exists because for efficiency, the decompressor may read more bytes from the underlying stream than necessary to produce the decompressed data. If you want to continue reading the underlying stream exactly after the point the DEFLATE-compressed data ends, then it is necessary to call this detach method.
This can only be called once, and is mutually exclusive with respect to calling
close()
. It is illegal to call read()
after detaching.
IllegalStateException
- if detach was already called or this stream has been closedIOException
- if an I/O exception occurredpublic void close() throws IOException
read()
or detach()
after closing.
It is idempotent to call this close()
method more than once.close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterInputStream
IOException
- if an I/O exception occurred in the underlying stream