Class OptimizedGZIPInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class OptimizedGZIPInputStream
    extends java.io.InputStream
    Optimized variant of GZIPInputStream that reuses underlying Deflater instance}.
    • Field Detail

      • INPUT_BUFFER_SIZE

        private static final int INPUT_BUFFER_SIZE
        What kinds of chunks do we feed underlying Inflater?
        See Also:
        Constant Field Values
      • _inflater

        protected java.util.zip.Inflater _inflater
      • _crc

        protected final java.util.zip.CRC32 _crc
      • _bufferRecycler

        protected final BufferRecycler _bufferRecycler
        Object that handles details of buffer recycling
      • _buffer

        protected byte[] _buffer
      • _bufferPtr

        protected int _bufferPtr
      • _bufferEnd

        protected int _bufferEnd
      • _tmpBuffer

        protected byte[] _tmpBuffer
        Temporary buffer used for single-byte reads, skipping.
      • _rawInput

        protected java.io.InputStream _rawInput
        Underlying input stream from which compressed data is to be read from.
    • Constructor Detail

      • OptimizedGZIPInputStream

        public OptimizedGZIPInputStream​(java.io.InputStream in)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • OptimizedGZIPInputStream

        public OptimizedGZIPInputStream​(java.io.InputStream in,
                                        BufferRecycler bufferRecycler,
                                        GZIPRecycler gzipRecycler)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • available

        public int available()
        Overrides:
        available in class java.io.InputStream
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • mark

        public void mark​(int limit)
        Overrides:
        mark in class java.io.InputStream
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • read

        public final int read()
                       throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public final int read​(byte[] buf)
                       throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public final int read​(byte[] buf,
                              int offset,
                              int len)
                       throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • _getTmpBuffer

        protected byte[] _getTmpBuffer()
      • _readHeader

        protected final void _readHeader()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • _readTrailer

        protected final void _readTrailer()
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • _skipBytes

        private final void _skipBytes​(int count)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • _readByte

        private final int _readByte()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • _readShort

        private final int _readShort()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • _readInt

        private final int _readInt()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • _loadMore

        private final void _loadMore()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • _loadMore

        private final void _loadMore​(int max)
                              throws java.io.IOException
        Throws:
        java.io.IOException