This class provides support for general purpose decompression using
the popular ZLIB compression library. The ZLIB compression library
was initially developed as part of the PNG graphics standard and is
not protected by patents. It is fully described in RFCs 1950, 1951,
and 1952, which can be found at
ftp://ds.internic.net/rfc in the files rfc1950.txt (zlib format),
rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
Creates a new decompressor. If the parameter 'nowrap' is true then
the ZLIB header and checksum fields will not be used in order to
support the compression format used by both GZIP and PKZIP.
Parameters:
nowrap - if true then support GZIP compatible compression
Inflater
public Inflater()
Creates a new decompressor.
setInput
public synchronized void setInput(byte b[],
int off,
int len)
Sets input data for decompression. Should be called whenever
needsInput() returns true indicating that more input data is
required.
setDictionary
public native synchronized void setDictionary(byte b[],
int off,
int len)
Sets the preset dictionary to the given array of bytes. Should be
called when inflate() returns 0 and needsDictionary() returns true
indicating that a preset dictionary is required. The method getAdler()
can be used to get the Adler-32 value of the dictionary needed.
Sets the preset dictionary to the given array of bytes. Should be
called when inflate() returns 0 and needsDictionary() returns true
indicating that a preset dictionary is required. The method getAdler()
can be used to get the Adler-32 value of the dictionary needed.
getRemaining
public synchronized int getRemaining()
Returns the total number of bytes remaining in the input buffer.
This can be used to find out what bytes still remain in the input
buffer after decompression has finished.
needsInput
public synchronized boolean needsInput()
Returns true if no data remains in the input buffer. This can
be used to determine if #setInput should be called in order
to provide more input.
needsDictionary
public synchronized boolean needsDictionary()
Returns true if a preset dictionary is needed for decompression.
Uncompresses bytes into specified buffer. Returns actual number
of bytes uncompressed. A return value of 0 indicates that
needsInput() or needsDictionary() should be called in order to
determine if more input data or a preset dictionary is required.
In the later case, getAdler() can be used to get the Adler-32
value of the dictionary required.
Uncompresses bytes into specified buffer. Returns actual number
of bytes uncompressed. A return value of 0 indicates that
needsInput() or needsDictionary() should be called in order to
determine if more input data or a preset dictionary is required.
In the later case, getAdler() can be used to get the Adler-32
value of the dictionary required.