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.
| Constructor and Description |
|---|
InflatingAsyncDataConsumer(AsyncDataConsumer downstream,
Boolean nowrapHint) |
| Modifier and Type | Method and Description |
|---|---|
void |
consume(ByteBuffer src) |
void |
releaseResources() |
void |
streamEnd(List<? extends Header> trailers) |
void |
updateCapacity(CapacityChannel ch) |
public InflatingAsyncDataConsumer(AsyncDataConsumer downstream, Boolean nowrapHint)
public void updateCapacity(CapacityChannel ch) throws IOException
updateCapacity in interface AsyncDataConsumerIOExceptionpublic void consume(ByteBuffer src) throws IOException
consume in interface AsyncDataConsumerIOExceptionpublic void streamEnd(List<? extends Header> trailers) throws HttpException, IOException
streamEnd in interface AsyncDataConsumerHttpExceptionIOExceptionpublic void releaseResources()
releaseResources in interface ResourceHolderCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.