Class InflatingGzipDataConsumer

java.lang.Object
org.apache.hc.client5.http.async.methods.InflatingGzipDataConsumer
All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.ResourceHolder

public final class InflatingGzipDataConsumer extends Object implements org.apache.hc.core5.http.nio.AsyncDataConsumer
Streaming AsyncDataConsumer that inflates Content-Encoding: gzip. It parses the GZIP header on the fly, passes the deflated body through a Inflater and verifies CRC + length trailer.

The implementation is fully non-blocking and honours back-pressure.

Since:
5.6
  • Constructor Details

    • InflatingGzipDataConsumer

      public InflatingGzipDataConsumer(org.apache.hc.core5.http.nio.AsyncDataConsumer downstream)
  • Method Details

    • updateCapacity

      public void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel c) throws IOException
      Specified by:
      updateCapacity in interface org.apache.hc.core5.http.nio.AsyncDataConsumer
      Throws:
      IOException
    • consume

      public void consume(ByteBuffer src) throws IOException
      Specified by:
      consume in interface org.apache.hc.core5.http.nio.AsyncDataConsumer
      Throws:
      IOException
    • streamEnd

      public void streamEnd(List<? extends org.apache.hc.core5.http.Header> trailers) throws org.apache.hc.core5.http.HttpException, IOException
      Specified by:
      streamEnd in interface org.apache.hc.core5.http.nio.AsyncDataConsumer
      Throws:
      org.apache.hc.core5.http.HttpException
      IOException
    • releaseResources

      public void releaseResources()
      Specified by:
      releaseResources in interface org.apache.hc.core5.http.nio.ResourceHolder