Class DeflatingGzipEntityProducer
java.lang.Object
org.apache.hc.client5.http.async.methods.DeflatingGzipEntityProducer
- All Implemented Interfaces:
org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.nio.AsyncDataProducer, org.apache.hc.core5.http.nio.AsyncEntityProducer, org.apache.hc.core5.http.nio.ResourceHolder
public final class DeflatingGzipEntityProducer
extends Object
implements org.apache.hc.core5.http.nio.AsyncEntityProducer
Streams an
AsyncEntityProducer through raw DEFLATE
and wraps the result in a valid GZIP container.
Memory usage is bounded (8 KiB buffers) and back-pressure from the I/O reactor is honoured.
- Since:
- 5.6
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CRC32private final Deflaterprivate final org.apache.hc.core5.http.nio.AsyncEntityProducerprivate booleanprivate booleanprivate final byte[]private static final intprivate static final intprivate final ByteBufferprivate final AtomicBooleanprivate long -
Constructor Summary
ConstructorsConstructorDescriptionDeflatingGzipEntityProducer(org.apache.hc.core5.http.nio.AsyncEntityProducer delegate) -
Method Summary
-
Field Details
-
IN_BUF
private static final int IN_BUF- See Also:
-
OUT_BUF
private static final int OUT_BUF- See Also:
-
delegate
private final org.apache.hc.core5.http.nio.AsyncEntityProducer delegate -
crc
-
deflater
-
in
private final byte[] in -
outBuf
-
headerSent
private boolean headerSent -
finished
private boolean finished -
uncompressed
private long uncompressed -
released
-
-
Constructor Details
-
DeflatingGzipEntityProducer
public DeflatingGzipEntityProducer(org.apache.hc.core5.http.nio.AsyncEntityProducer delegate)
-
-
Method Details
-
isRepeatable
public boolean isRepeatable()- Specified by:
isRepeatablein interfaceorg.apache.hc.core5.http.nio.AsyncEntityProducer
-
getContentLength
public long getContentLength()- Specified by:
getContentLengthin interfaceorg.apache.hc.core5.http.EntityDetails
-
getContentType
- Specified by:
getContentTypein interfaceorg.apache.hc.core5.http.EntityDetails
-
getContentEncoding
- Specified by:
getContentEncodingin interfaceorg.apache.hc.core5.http.EntityDetails
-
isChunked
public boolean isChunked()- Specified by:
isChunkedin interfaceorg.apache.hc.core5.http.EntityDetails
-
getTrailerNames
-
available
public int available()- Specified by:
availablein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
-
produce
- Specified by:
producein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer- Throws:
IOException
-
deflateToOut
private void deflateToOut() -
flushOut
- Throws:
IOException
-
failed
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncEntityProducer
-
releaseResources
public void releaseResources()- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-