com.ning.compress.Uncompressor implementation for uncompressing
GZIP encoded data in "push" mode, in which input is not
read using java.io.InputStream but rather pushed to
uncompressor in variable length chunks.
| Modifier and Type | Field and Description |
|---|---|
| protected final CRC32 | |
| protected byte[] | _decodeBuffer
Buffer used for data uncompressed from |
| protected int | _flags
Header flags read from gzip header |
| protected final GZIPRecycler | |
| protected final DataHandler | _handler
Handler that will receive uncompressed data. |
| protected int | _headerCRC
Expected CRC for header, from gzip file itself. |
| protected Inflater | |
| protected final int | |
| protected final BufferRecycler | _recycler
Object that handles details of buffer recycling |
| protected int | _skippedBytes
Simple counter used when skipping fixed number of bytes |
| protected int | _state
Current decoding state, which determines meaning of following byte(s). |
| protected boolean | _terminated
Flag set if |
| protected int | _trailerCount
Number of bytes that trailer indicates preceding data stream should have had. |
| protected int | _trailerCRC
CRC container in trailer, should match calculated CRC over data |
| protected static final int | DECODE_BUFFER_SIZE
For decoding we should use buffer that is big enough to contain typical amount of decoded data; 64k seems like a nice big number |
| protected static final int | DEFAULT_CHUNK_SIZE
Size of input chunks fed to underlying decoder. |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final byte | |
| protected static final byte | |
| protected static final int | STATE_BODY
State in which we are buffering compressed data for decompression |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | STATE_INITIAL
State in which a new compression stream can start. |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | GZIPUncompressor(DataHandler h, int inputChunkLength, BufferRecycler bufferRecycler, GZIPRecycler gzipRecycler)
|
| Modifier and Type | Method and Description |
|---|---|
| private final int | |
| private final int | |
| protected final boolean | |
| protected void | |
| protected void | |
| protected void | |
| public void | complete()
Implements abstract com. |
| public boolean | feedCompressedData(byte[] comp, int offset, int len)
Implements abstract com. |
| _crc | back to summary |
|---|---|
| protected final CRC32 _crc | |
| _decodeBuffer | back to summary |
|---|---|
| protected byte[] _decodeBuffer Buffer used for data uncompressed from | |
| _flags | back to summary |
|---|---|
| protected int _flags Header flags read from gzip header | |
| _gzipRecycler | back to summary |
|---|---|
| protected final GZIPRecycler _gzipRecycler | |
| _handler | back to summary |
|---|---|
| protected final DataHandler _handler Handler that will receive uncompressed data. | |
| _headerCRC | back to summary |
|---|---|
| protected int _headerCRC Expected CRC for header, from gzip file itself. | |
| _inflater | back to summary |
|---|---|
| protected Inflater _inflater | |
| _inputChunkLength | back to summary |
|---|---|
| protected final int _inputChunkLength | |
| _recycler | back to summary |
|---|---|
| protected final BufferRecycler _recycler Object that handles details of buffer recycling | |
| _skippedBytes | back to summary |
|---|---|
| protected int _skippedBytes Simple counter used when skipping fixed number of bytes | |
| _state | back to summary |
|---|---|
| protected int _state Current decoding state, which determines meaning of following byte(s). | |
| _terminated | back to summary |
|---|---|
| protected boolean _terminated Flag set if | |
| _trailerCount | back to summary |
|---|---|
| protected int _trailerCount Number of bytes that trailer indicates preceding data stream should have had. | |
| _trailerCRC | back to summary |
|---|---|
| protected int _trailerCRC CRC container in trailer, should match calculated CRC over data | |
| DECODE_BUFFER_SIZE | back to summary |
|---|---|
| protected static final int DECODE_BUFFER_SIZE For decoding we should use buffer that is big enough to contain typical amount of decoded data; 64k seems like a nice big number | |
| DEFAULT_CHUNK_SIZE | back to summary |
|---|---|
| protected static final int DEFAULT_CHUNK_SIZE Size of input chunks fed to underlying decoder. Since it is not 100% clear what its effects are on | |
| FCOMMENT | back to summary |
|---|---|
| protected static final int FCOMMENT | |
| FEXTRA | back to summary |
|---|---|
| protected static final int FEXTRA | |
| FHCRC | back to summary |
|---|---|
| protected static final int FHCRC | |
| FNAME | back to summary |
|---|---|
| protected static final int FNAME | |
| GZIP_MAGIC | back to summary |
|---|---|
| protected static final int GZIP_MAGIC | |
| GZIP_MAGIC_0 | back to summary |
|---|---|
| protected static final byte GZIP_MAGIC_0 | |
| GZIP_MAGIC_1 | back to summary |
|---|---|
| protected static final byte GZIP_MAGIC_1 | |
| STATE_BODY | back to summary |
|---|---|
| protected static final int STATE_BODY State in which we are buffering compressed data for decompression | |
| STATE_HEADER_COMMENT | back to summary |
|---|---|
| protected static final int STATE_HEADER_COMMENT | |
| STATE_HEADER_COMP_TYPE | back to summary |
|---|---|
| protected static final int STATE_HEADER_COMP_TYPE | |
| STATE_HEADER_CRC0 | back to summary |
|---|---|
| protected static final int STATE_HEADER_CRC0 | |
| STATE_HEADER_CRC1 | back to summary |
|---|---|
| protected static final int STATE_HEADER_CRC1 | |
| STATE_HEADER_EXTRA0 | back to summary |
|---|---|
| protected static final int STATE_HEADER_EXTRA0 | |
| STATE_HEADER_EXTRA1 | back to summary |
|---|---|
| protected static final int STATE_HEADER_EXTRA1 | |
| STATE_HEADER_FLAGS | back to summary |
|---|---|
| protected static final int STATE_HEADER_FLAGS | |
| STATE_HEADER_FNAME | back to summary |
|---|---|
| protected static final int STATE_HEADER_FNAME | |
| STATE_HEADER_SIG1 | back to summary |
|---|---|
| protected static final int STATE_HEADER_SIG1 | |
| STATE_HEADER_SKIP | back to summary |
|---|---|
| protected static final int STATE_HEADER_SKIP | |
| STATE_INITIAL | back to summary |
|---|---|
| protected static final int STATE_INITIAL State in which a new compression stream can start. | |
| STATE_TRAILER_CRC1 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_CRC1 | |
| STATE_TRAILER_CRC2 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_CRC2 | |
| STATE_TRAILER_CRC3 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_CRC3 | |
| STATE_TRAILER_INITIAL | back to summary |
|---|---|
| protected static final int STATE_TRAILER_INITIAL | |
| STATE_TRAILER_LEN0 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_LEN0 | |
| STATE_TRAILER_LEN1 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_LEN1 | |
| STATE_TRAILER_LEN2 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_LEN2 | |
| STATE_TRAILER_LEN3 | back to summary |
|---|---|
| protected static final int STATE_TRAILER_LEN3 | |
| GZIPUncompressor | back to summary |
|---|---|
| public GZIPUncompressor(DataHandler h) | |
| GZIPUncompressor | back to summary |
|---|---|
| public GZIPUncompressor(DataHandler h, int inputChunkLength) | |
| GZIPUncompressor | back to summary |
|---|---|
| public GZIPUncompressor(DataHandler h, int inputChunkLength, BufferRecycler bufferRecycler, GZIPRecycler gzipRecycler) | |
| _handleHeader | back to summary |
|---|---|
| private final int _handleHeader(byte[] comp, int offset, final int end) throws IOException | |
| _handleTrailer | back to summary |
|---|---|
| private final int _handleTrailer(byte[] comp, int offset, final int end) throws IOException | |
| _hasFlag | back to summary |
|---|---|
| protected final boolean _hasFlag(int flag) | |
| _reportBadHeader | back to summary |
|---|---|
| protected void _reportBadHeader(byte[] comp, int nextOffset, int end, int relative) throws GZIPException | |
| _throwInternal | back to summary |
|---|---|
| protected void _throwInternal() throws GZIPException | |
| _throwInternal | back to summary |
|---|---|
| protected void _throwInternal(String msg) throws GZIPException | |
| complete | back to summary |
|---|---|
| public void complete() throws IOException Implements abstract com. Doc from com. Method called to indicate that all data to uncompress has already been fed. This typically results in last block of data being uncompressed, and results being sent to listener(s); but may also throw an exception if incomplete block was passed.
| |
| feedCompressedData | back to summary |
|---|---|
| public boolean feedCompressedData(byte[] comp, int offset, int len) throws IOException Implements abstract com. Doc from com. Method called to feed more compressed data to be uncompressed, and sent to possible listeners. Note return value was added (from void to boolean) in 0.9.9 | |