Package net.i2p.util

Class ResettableGZIPInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    ReusableGZIPInputStream

    public class ResettableGZIPInputStream
    extends InflaterInputStream
    GZIP implementation per RFC 1952, reusing java's standard CRC32 and Inflater and InflaterInputStream implementations. The main difference is that this implementation allows its state to be reset to initial values, and hence reused, while the standard GZIPInputStream reads the GZIP header from the stream on instantiation.
    • Constructor Detail

      • ResettableGZIPInputStream

        public ResettableGZIPInputStream()
        Build a new GZIP stream without a bound compressed stream. You need to initialize this with initialize(compressedStream) when you want to decompress a stream.
    • Method Detail

      • initialize

        public void initialize​(InputStream compressedStream)
                        throws IOException
        Blocking call to initialize this stream with the data from the given compressed stream.
        Throws:
        IOException
      • getTotalRead

        public long getTotalRead()
        Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream
        Since:
        0.8.9
      • getTotalExpanded

        public long getTotalExpanded()
        Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream
        Since:
        0.8.9
      • getRemaining

        public long getRemaining()
        Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream
        Since:
        0.8.9
      • getFinished

        public boolean getFinished()
        Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream
        Since:
        0.8.9
      • destroy

        public void destroy()
                     throws IOException
        Calls super.close(). May not be reused after this.
        Throws:
        IOException
        Since:
        0.9.40
      • toString

        public String toString()
        Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream
        Overrides:
        toString in class Object
        Since:
        0.8.9