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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBooleanprivate final CRC32private final org.apache.hc.core5.http.nio.AsyncDataConsumerprivate final ByteArrayOutputStreamprivate booleanprivate final Inflaterprivate final byte[]private static final int -
Constructor Summary
ConstructorsConstructorDescriptionInflatingGzipDataConsumer(org.apache.hc.core5.http.nio.AsyncDataConsumer downstream) -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume(ByteBuffer src) voidvoidvoidupdateCapacity(org.apache.hc.core5.http.nio.CapacityChannel c)
-
Field Details
-
OUT
private static final int OUT- See Also:
-
downstream
private final org.apache.hc.core5.http.nio.AsyncDataConsumer downstream -
inflater
-
crc
-
out
private final byte[] out -
headerBuf
-
headerDone
private boolean headerDone -
closed
-
-
Constructor Details
-
InflatingGzipDataConsumer
public InflatingGzipDataConsumer(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
-