Class BasicAsyncEntityConsumer
java.lang.Object
org.apache.hc.core5.http.nio.entity.AbstractBinDataConsumer
org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityConsumer<byte[]>
org.apache.hc.core5.http.nio.entity.BasicAsyncEntityConsumer
- All Implemented Interfaces:
AsyncDataConsumer,AsyncEntityConsumer<byte[]>,ResourceHolder
Basic
AsyncEntityConsumer implementation
that processes the data stream content into a byte array.- Since:
- 5.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intTriggered to obtain the capacity increment.protected voiddata(ByteBuffer src, boolean endOfStream) Triggered to pass incoming data packet to the data consumer.protected byte[]Triggered to generate entity representation.voidprotected voidstreamStart(ContentType contentType) Triggered to signal beginning of entity content stream.Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityConsumer
completed, failed, getContent, streamStartMethods inherited from class org.apache.hc.core5.http.nio.entity.AbstractBinDataConsumer
consume, streamEnd, updateCapacityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer
consume, streamEnd, updateCapacity
-
Field Details
-
buffer
-
-
Constructor Details
-
BasicAsyncEntityConsumer
public BasicAsyncEntityConsumer()
-
-
Method Details
-
streamStart
Description copied from class:AbstractBinAsyncEntityConsumerTriggered to signal beginning of entity content stream.- Specified by:
streamStartin classAbstractBinAsyncEntityConsumer<byte[]>- Parameters:
contentType- the entity content type- Throws:
HttpExceptionIOException
-
capacityIncrement
protected int capacityIncrement()Description copied from class:AbstractBinDataConsumerTriggered to obtain the capacity increment.- Specified by:
capacityIncrementin classAbstractBinDataConsumer- Returns:
- the number of bytes this consumer is prepared to process.
-
data
Description copied from class:AbstractBinDataConsumerTriggered to pass incoming data packet to the data consumer.- Specified by:
datain classAbstractBinDataConsumer- Parameters:
src- the data packet.endOfStream- flag indicating whether this data packet is the last in the data stream.- Throws:
IOException
-
generateContent
Description copied from class:AbstractBinAsyncEntityConsumerTriggered to generate entity representation.- Specified by:
generateContentin classAbstractBinAsyncEntityConsumer<byte[]>- Returns:
- the entity content
- Throws:
IOException
-
releaseResources
public void releaseResources()
-