|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bolet.jgz.Inflater
public final class Inflater
An Inflater
instance handles the transformation of
compressed data bytes, read from a user-specified stream, into the
corresponding uncompressed data bytes.
The engine can be reset at any time, and work over various stream
instances. Deflated data is organized into successive blocks, the
last block being marked as such. This class is
Constructor Summary | |
---|---|
Inflater()
Create a new engine. |
Method Summary | |
---|---|
boolean |
nextBlock()
Get the next block header. |
void |
processDictionary(byte[] dict)
Process a dictionary. |
void |
processDictionary(byte[] dict,
int off,
int len)
Process a dictionary. |
void |
processDictionary(java.io.InputStream dict)
Process a dictionary. |
int |
readAll(byte[] buf,
int off,
int len)
Uncompress some data. |
int |
readBlock(byte[] buf,
int off,
int len)
Uncompress some data from the current block. |
void |
reset(java.io.InputStream in)
Reset the engine, to work over the provided stream. |
void |
setRawStream(java.io.InputStream in)
Change the input stream, but keep the running state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Inflater()
Method Detail |
---|
public void reset(java.io.InputStream in)
in
- the input stream for compressed datapublic void setRawStream(java.io.InputStream in)
in
- the new input stream for compressed datapublic void processDictionary(java.io.InputStream dict) throws java.io.IOException
Process a dictionary. This is stream of bytes which will be assumed to have just been decompressed. Conceptually, the compressor also used that dictionary; this allows some backwards references to byte sequences in that data stream.
The dictionary stream is read until its end.
dict
- the dictionary stream
java.io.IOException
- on I/O error with the dictionary streampublic void processDictionary(byte[] dict)
Process a dictionary. This is stream of bytes which will be assumed to have just been decompressed. Conceptually, the compressor also used that dictionary; this allows some backwards references to byte sequences in that data stream.
dict
- the dictionarypublic void processDictionary(byte[] dict, int off, int len)
Process a dictionary. This is stream of bytes which will be assumed to have just been decompressed. Conceptually, the compressor also used that dictionary; this allows some backwards references to byte sequences in that data stream.
dict
- the dictionaryoff
- the dictionary offsetlen
- the dictionary lengthpublic int readBlock(byte[] buf, int off, int len) throws java.io.IOException
buf
- the output bufferoff
- the output buffer offsetlen
- the output buffer length (in bytes)
java.io.IOException
public boolean nextBlock() throws java.io.IOException
true
on success (next block header read
and processed), false
otherwise (the previous
block was marked final). Format error, including unexpected
end-of-stream from the underlying input stream, are reported
as IOException
or subclasses thereof (e.g.
JGZException
).
true
on success, false
on
logical end of compressed stream
java.io.IOException
- on I/O or format errorpublic int readAll(byte[] buf, int off, int len) throws java.io.IOException
len
only if the end of the final block was reached. If no
uncompressed byte was read, then 0 is returned.
buf
- the output bufferoff
- the output buffer offsetlen
- the output buffer length (in bytes)
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |