Package 

Class InflaterSource

  • All Implemented Interfaces:
    com.mobwith.httpmodule.Source , java.io.Closeable , java.lang.AutoCloseable

    
    public final class InflaterSource
     implements Source
                        

    A source that uses DEFLATEto decompress data read from another source.

    • Method Summary

      Modifier and Type Method Description
      long read(Buffer sink, long byteCount) Removes at least 1, and up to {@code byteCount} bytes from this and appendsthem to {@code sink}.
      final boolean refill() Refills the inflater with compressed data if it needs input.
      Timeout timeout() Returns the timeout for this source.
      void close() Closes this source and releases the resources held by this source.
      • Methods inherited from class com.mobwith.httpmodule.Source

        read
      • Methods inherited from class java.io.Closeable

        close
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • read

         long read(Buffer sink, long byteCount)

        Removes at least 1, and up to {@code byteCount} bytes from this and appendsthem to {@code sink}. Returns the number of bytes read, or -1 if thissource is exhausted.

      • refill

         final boolean refill()

        Refills the inflater with compressed data if it needs input. (And only ifit needs input). Returns true if the inflater required input but the sourcewas exhausted.

      • close

         void close()

        Closes this source and releases the resources held by this source. It is anerror to read a closed source. It is safe to close a source more than once.