public class ChunkedInflaterInputStream
extends java.io.FilterInputStream
InflaterInputStream
but in addition to its original, this one can
handle several chunks of compressed data on the same underlying stream.
such streams are for example generated by the
ChunkedDeflaterOutputStream
.Constructor and Description |
---|
ChunkedInflaterInputStream(java.io.InputStream in)
Creates a new input stream with a default decompressor and buffer size.
|
ChunkedInflaterInputStream(java.io.InputStream in,
java.util.zip.Inflater inf)
Creates a new input stream with the specified decompressor and a
default buffer size.
|
ChunkedInflaterInputStream(java.io.InputStream in,
java.util.zip.Inflater inf,
int size)
Creates a new input stream with the specified decompressor and
buffer size.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns 0 after EOF has reached, otherwise always return 1.
|
void |
close()
Closes the input stream.
|
int |
read()
Reads a byte of uncompressed data.
|
int |
read(byte[] b,
int off,
int len)
Reads uncompressed data into an array of bytes.
|
long |
skip(long n)
Skips specified number of bytes of uncompressed data.
|
public ChunkedInflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf, int size)
in
- the input streaminf
- the decompressor ("inflater")size
- the input buffer sizejava.lang.IllegalArgumentException
- if size is <= 0public ChunkedInflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf)
in
- the input streaminf
- the decompressor ("inflater")public ChunkedInflaterInputStream(java.io.InputStream in)
in
- the input streampublic int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
- if an I/O error has occurredpublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes readjava.util.zip.ZipException
- if a ZIP format error has occurredjava.io.IOException
- if an I/O error has occurredpublic int available() throws java.io.IOException
Programs should not count on this method to return the actual number of bytes that could be read without blocking.
available
in class java.io.FilterInputStream
java.io.IOException
- if an I/O error occurs.public long skip(long n) throws java.io.IOException
skip
in class java.io.FilterInputStream
n
- the number of bytes to skipjava.io.IOException
- if an I/O error has occurredjava.lang.IllegalArgumentException
- if n < 0public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterInputStream
java.io.IOException
- if an I/O error has occurred"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"