public class OptimizedGZIPInputStream
extends java.io.InputStream
GZIPInputStream
that
reuses underlying Deflater
instance}.Modifier and Type | Class and Description |
---|---|
(package private) static class |
OptimizedGZIPInputStream.State
Enumeration used for keeping track of decoding state within
stream
|
Modifier and Type | Field and Description |
---|---|
protected byte[] |
_buffer |
protected int |
_bufferEnd |
protected int |
_bufferPtr |
protected BufferRecycler |
_bufferRecycler
Object that handles details of buffer recycling
|
protected java.util.zip.CRC32 |
_crc |
protected GZIPRecycler |
_gzipRecycler |
protected java.util.zip.Inflater |
_inflater |
protected java.io.InputStream |
_rawInput
Underlying input stream from which compressed data is to be
read from.
|
protected OptimizedGZIPInputStream.State |
_state
Flag set to true during handling of header processing
|
protected byte[] |
_tmpBuffer
Temporary buffer used for single-byte reads, skipping.
|
private static int |
INPUT_BUFFER_SIZE
What kinds of chunks do we feed underlying
Inflater ? |
Constructor and Description |
---|
OptimizedGZIPInputStream(java.io.InputStream in) |
OptimizedGZIPInputStream(java.io.InputStream in,
BufferRecycler bufferRecycler,
GZIPRecycler gzipRecycler) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
_getTmpBuffer() |
private void |
_loadMore() |
private void |
_loadMore(int max) |
private int |
_readByte() |
protected void |
_readHeader() |
private int |
_readInt() |
private int |
_readShort() |
protected void |
_readTrailer() |
private void |
_skipBytes(int count) |
int |
available() |
void |
close() |
void |
mark(int limit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] buf) |
int |
read(byte[] buf,
int offset,
int len) |
void |
reset() |
long |
skip(long n) |
private static final int INPUT_BUFFER_SIZE
Inflater
?protected java.util.zip.Inflater _inflater
protected final java.util.zip.CRC32 _crc
protected final BufferRecycler _bufferRecycler
protected final GZIPRecycler _gzipRecycler
protected byte[] _buffer
protected int _bufferPtr
protected int _bufferEnd
protected byte[] _tmpBuffer
protected java.io.InputStream _rawInput
protected OptimizedGZIPInputStream.State _state
public OptimizedGZIPInputStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public OptimizedGZIPInputStream(java.io.InputStream in, BufferRecycler bufferRecycler, GZIPRecycler gzipRecycler) throws java.io.IOException
java.io.IOException
public int available()
available
in class java.io.InputStream
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public void mark(int limit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public final int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public final int read(byte[] buf) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public final int read(byte[] buf, int offset, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
protected byte[] _getTmpBuffer()
protected final void _readHeader() throws java.io.IOException
java.io.IOException
protected final void _readTrailer() throws java.io.IOException
java.io.IOException
private final void _skipBytes(int count) throws java.io.IOException
java.io.IOException
private final int _readByte() throws java.io.IOException
java.io.IOException
private final int _readShort() throws java.io.IOException
java.io.IOException
private final int _readInt() throws java.io.IOException
java.io.IOException
private final void _loadMore() throws java.io.IOException
java.io.IOException
private final void _loadMore(int max) throws java.io.IOException
java.io.IOException