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

## Class InflatingZstdDataConsumer

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

All Implemented Interfaces:
  AsyncDataConsumer, ResourceHolder

    public final class InflatingZstdDataConsumer
    extends Object
    implements AsyncDataConsumer

`AsyncDataConsumer` that inflates Zstandard (zstd) content codings.

This consumer accepts compressed bytes and forwards decompressed data to a downstream `AsyncDataConsumer`. It is intended to be installed by the client execution chain when a response carries `Content-Encoding: zstd`. Applications normally do not instantiate it directly—enable content compression (default) and let `ContentCompressionAsyncExec` wire it automatically.

Behavior

- Streams decompression as data arrives; does not require the full message in memory.
- Updates the downstream with plain bytes; the client removes the original `Content-Encoding` and related headers.
- On malformed input it throws an `IOException` with a descriptive message.
- `releaseResources()` must be called to free native resources.

Since:
  5.6

### Constructor Summary

Constructors
Constructor and Description
`InflatingZstdDataConsumer(AsyncDataConsumer downstream)`

### Method Summary

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

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

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

### Constructor Detail

#### InflatingZstdDataConsumer

    public InflatingZstdDataConsumer(AsyncDataConsumer downstream)

### Method Detail

#### updateCapacity

    public void updateCapacity(CapacityChannel c)
                        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`