Class InflatingZstdDataConsumer
java.lang.Object
org.apache.hc.client5.http.async.methods.InflatingZstdDataConsumer
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.ResourceHolder
public final class InflatingZstdDataConsumer
extends Object
implements org.apache.hc.core5.http.nio.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-Encodingand related headers. - On malformed input it throws an
IOExceptionwith a descriptive message. releaseResources()must be called to free native resources.
- Since:
- 5.6
-
Constructor Summary
ConstructorsConstructorDescriptionInflatingZstdDataConsumer(org.apache.hc.core5.http.nio.AsyncDataConsumer downstream) -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume(ByteBuffer src) voidvoidvoidupdateCapacity(org.apache.hc.core5.http.nio.CapacityChannel c)
-
Constructor Details
-
InflatingZstdDataConsumer
public InflatingZstdDataConsumer(org.apache.hc.core5.http.nio.AsyncDataConsumer downstream)
-
-
Method Details
-
updateCapacity
- Specified by:
updateCapacityin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
IOException
-
consume
- Specified by:
consumein interfaceorg.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:
streamEndin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
releaseResources
public void releaseResources()- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-