java.util.zip
public class Inflater extends Object
setInput()
, then inflate() it. If inflate doesn't
inflate any bytes there may be three reasons:
setInput()
.
NOTE: needsInput() also returns true when, the stream is finished.
setDictionary()
.Since: JDK 1.1
UNKNOWN: May 17, 1999
Constructor Summary | |
---|---|
Inflater()
Creates a new inflater. | |
Inflater(boolean nowrap)
Creates a new inflater. |
Method Summary | |
---|---|
void | end()
Frees all objects allocated by the inflater. |
protected void | finalize()
Finalizes this object. |
boolean | finished()
Returns true, if the inflater has finished. |
int | getAdler()
Gets the adler checksum. |
long | getBytesRead()
Gets the total number of processed compressed input bytes. |
long | getBytesWritten()
Gets the total number of output bytes returned by inflate(). |
int | getRemaining()
Gets the number of unprocessed input. |
int | inflate(byte[] buf)
Inflates the compressed stream to the output buffer. |
int | inflate(byte[] buf, int off, int len)
Inflates the compressed stream to the output buffer. |
boolean | needsDictionary()
Returns true, if a preset dictionary is needed to inflate the input. |
boolean | needsInput()
Returns true, if the input buffer is empty.
|
void | reset()
Resets the inflater so that a new stream can be decompressed. |
void | setDictionary(byte[] buffer)
Sets the preset dictionary. |
void | setDictionary(byte[] buffer, int off, int len)
Sets the preset dictionary. |
void | setInput(byte[] buf)
Sets the input. |
void | setInput(byte[] buf, int off, int len)
Sets the input. |
Parameters: nowrap true if no header and checksum field appears in the stream. This is used for GZIPed input. For compatibility with Sun JDK you should provide one byte of input more than needed in this case.
UNKNOWN: the adler checksum.
Returns: the total number of bytes of processed input bytes.
Since: 1.5
Returns: the total number of output bytes.
Since: 1.5
Returns: the number of bytes of the input which were not processed.
Parameters: buf the output buffer.
Returns: the number of bytes written to the buffer, 0 if no further output can be produced.
Throws: DataFormatException if deflated stream is invalid. IllegalArgumentException if buf has length 0.
Parameters: buf the output buffer. off the offset into buffer where the output should start. len the maximum length of the output.
Returns: the number of bytes written to the buffer, 0 if no further output can be produced.
Throws: DataFormatException if deflated stream is invalid. IndexOutOfBoundsException if the off and/or len are wrong.
Parameters: buffer the dictionary.
Throws: IllegalStateException if no dictionary is needed. IllegalArgumentException if the dictionary checksum is wrong.
Parameters: buffer the dictionary. off the offset into buffer where the dictionary starts. len the length of the dictionary.
Throws: IllegalStateException if no dictionary is needed. IllegalArgumentException if the dictionary checksum is wrong. IndexOutOfBoundsException if the off and/or len are wrong.
Parameters: buf the input.
Throws: IllegalStateException if no input is needed.
Parameters: buf the input. off the offset into buffer where the input starts. len the length of the input.
Throws: IllegalStateException if no input is needed. IndexOutOfBoundsException if the off and/or len are wrong.