org.apache.hc.client5.http.async.methods

## Class InflatingAsyncDataConsumer

- java.lang.Object
- - org.apache.hc.client5.http.async.methods.InflatingAsyncDataConsumer

All Implemented Interfaces:
  AsyncDataConsumer, ResourceHolder

    public final class InflatingAsyncDataConsumer
    extends Object
    implements AsyncDataConsumer

Streaming, non-blocking `AsyncDataConsumer` that transparently inflates a response whose `Content-Encoding` is `deflate`. The decoded bytes are pushed straight to the wrapped downstream consumer while honouring reactor back-pressure.

The implementation understands both formats that exist “in the wild”: the raw DEFLATE stream (RFC 1951) and the zlib-wrapped variant (RFC 1950). If the caller does not specify which one to expect, the first two bytes of the stream are inspected and the proper decoder is chosen automatically.

No `InputStream`/`OutputStream` buffering is used; memory footprint is bounded and suitable for very large payloads.

Since:
  5.6

### Constructor Summary

Constructors
Constructor and Description
`InflatingAsyncDataConsumer(AsyncDataConsumer downstream, Boolean nowrapHint)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `consume(ByteBuffer src)`
`void` `releaseResources()`
`void` `streamEnd(List<? extends Header> trailers)`
`void` `updateCapacity(CapacityChannel ch)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### InflatingAsyncDataConsumer

    public InflatingAsyncDataConsumer(AsyncDataConsumer downstream,
                                      Boolean nowrapHint)

### Method Detail

#### updateCapacity

    public void updateCapacity(CapacityChannel ch)
                        throws IOException

Specified by:
  `updateCapacity` in interface `AsyncDataConsumer`
Throws:
  `IOException`

#### consume

    public void consume(ByteBuffer src)
                 throws IOException

Specified by:
  `consume` in interface `AsyncDataConsumer`
Throws:
  `IOException`

#### streamEnd

    public void streamEnd(List<? extends Header> trailers)
                   throws HttpException,
                          IOException

Specified by:
  `streamEnd` in interface `AsyncDataConsumer`
Throws:
  `HttpException`
  `IOException`

#### releaseResources

    public void releaseResources()

Specified by:
  `releaseResources` in interface `ResourceHolder`