Class OptimizedGZIPInputStream
java.lang.Object
java.io.InputStream
com.ning.compress.gzip.OptimizedGZIPInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
Optimized variant of
GZIPInputStream that
reuses underlying Deflater instance}.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumEnumeration used for keeping track of decoding state within stream -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected intprotected intprotected final BufferRecyclerObject that handles details of buffer recyclingprotected final CRC32protected final GZIPRecyclerprotected Inflaterprotected InputStreamUnderlying input stream from which compressed data is to be read from.protected OptimizedGZIPInputStream.StateFlag set to true during handling of header processingprotected byte[]Temporary buffer used for single-byte reads, skipping.private static final intWhat kinds of chunks do we feed underlyingInflater? -
Constructor Summary
ConstructorsConstructorDescriptionOptimizedGZIPInputStream(InputStream in, BufferRecycler bufferRecycler, GZIPRecycler gzipRecycler) -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]private final voidprivate final void_loadMore(int max) private final intprotected final voidprivate final int_readInt()private final intprotected final voidprivate final void_skipBytes(int count) intvoidclose()voidmark(int limit) booleanfinal intread()final intread(byte[] buf) final intread(byte[] buf, int offset, int len) voidreset()longskip(long n) Methods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
INPUT_BUFFER_SIZE
private static final int INPUT_BUFFER_SIZEWhat kinds of chunks do we feed underlyingInflater?- See Also:
-
_inflater
-
_crc
-
_bufferRecycler
Object that handles details of buffer recycling -
_gzipRecycler
-
_buffer
protected byte[] _buffer -
_bufferPtr
protected int _bufferPtr -
_bufferEnd
protected int _bufferEnd -
_tmpBuffer
protected byte[] _tmpBufferTemporary buffer used for single-byte reads, skipping. -
_rawInput
Underlying input stream from which compressed data is to be read from. -
_state
Flag set to true during handling of header processing
-
-
Constructor Details
-
OptimizedGZIPInputStream
- Throws:
IOException
-
OptimizedGZIPInputStream
public OptimizedGZIPInputStream(InputStream in, BufferRecycler bufferRecycler, GZIPRecycler gzipRecycler) throws IOException - Throws:
IOException
-
-
Method Details
-
available
public int available()- Overrides:
availablein classInputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int limit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
_getTmpBuffer
protected byte[] _getTmpBuffer() -
_readHeader
- Throws:
IOException
-
_readTrailer
- Throws:
IOException
-
_skipBytes
- Throws:
IOException
-
_readByte
- Throws:
IOException
-
_readShort
- Throws:
IOException
-
_readInt
- Throws:
IOException
-
_loadMore
- Throws:
IOException
-
_loadMore
- Throws:
IOException
-