public class InflaterInputStream extends FilterInputStream
This class works exactly the same as java.util.zip.Inflater, however the java.util.zip package is an optional package for the Eve VM. However this version of Inflater and InflaterInputStream will always exist in any Eve VM.
This stream may form the basis for other decompression filters, such
as the GZIPInputStream
.
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
Byte array used as a buffer
|
protected Inflater |
inf
Decompressor for this filter
|
protected int |
len |
in
Constructor and Description |
---|
InflaterInputStream(InputStream in)
Create an InflaterInputStream with the default decompresseor
and a default buffer size.
|
InflaterInputStream(InputStream in,
Inflater inf)
Create an InflaterInputStream with the specified decompresseor
and a default buffer size.
|
InflaterInputStream(InputStream in,
Inflater inf,
int size)
Create an InflaterInputStream with the specified decompresseor
and a specified buffer size.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns 0 once the end of the stream (EOF) has been reached.
|
void |
close()
Closes the input stream
|
protected boolean |
fill()
Fills the buffer with more data to decompress.
|
boolean |
markSupported()
Since this stream tends to buffer large (unpredictable?)
|
int |
read()
Reads one byte of decompressed data.
|
int |
read(byte[] b,
int off,
int len)
Decompresses data into the byte array
|
long |
skip(long n)
Skip specified number of bytes of uncompressed data
|
mark, read, reset
finalize, hashCode
protected Inflater inf
protected byte[] buf
protected int len
public InflaterInputStream(InputStream in)
in
- the InputStream to read bytes frompublic InflaterInputStream(InputStream in, Inflater inf)
in
- the InputStream to read bytes frominf
- the decompressor used to decompress data read from inpublic InflaterInputStream(InputStream in, Inflater inf, int size)
in
- the InputStream to read bytes frominf
- the decompressor used to decompress data read from insize
- size of the buffer to usepublic int available() throws IOException
available
in class FilterInputStream
in.available()
IOException
- If an error occurspublic void close() throws IOException
close
in class FilterInputStream
IOException
- If an error occursprotected boolean fill() throws IOException
IOException
public int read() throws IOException
read
in class FilterInputStream
in.read()
IOException
- If an error occurspublic int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
b
- the array to read and decompress data intooff
- the offset indicating where the data should be placedlen
- the number of bytes to decompressin.read(byte[], int, int)
IOException
- If an error occurspublic long skip(long n) throws IOException
skip
in class FilterInputStream
n
- number of bytes to skipin.skip(long)
IOException
- If an error occurspublic boolean markSupported()
markSupported
in class FilterInputStream