Class StringAsyncEntityConsumer
java.lang.Object
org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer<String>
org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer
- All Implemented Interfaces:
AsyncDataConsumer,AsyncEntityConsumer<String>,ResourceHolder
Basic
AsyncEntityConsumer implementation
that processes the data stream content into a string.- Since:
- 5.0
-
Field Summary
FieldsFields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
DEF_BUF_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionStringAsyncEntityConsumer(int capacityIncrement) StringAsyncEntityConsumer(int bufSize, int capacityIncrement, CharCodingConfig charCodingConfig) StringAsyncEntityConsumer(CharCodingConfig charCodingConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected intTriggered to obtain the capacity increment.protected final voiddata(CharBuffer src, boolean endOfStream) Triggered to pass incoming data packet to the data consumer.Triggered to generate entity representation.voidprotected final voidstreamStart(ContentType contentType) Triggered to signal beginning of entity content stream.Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer
completed, failed, getContent, streamStartMethods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
consume, setCharset, 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
-
capacityIncrement
private final int capacityIncrement -
-
-
Constructor Details
-
StringAsyncEntityConsumer
public StringAsyncEntityConsumer(int bufSize, int capacityIncrement, CharCodingConfig charCodingConfig) -
StringAsyncEntityConsumer
public StringAsyncEntityConsumer(int capacityIncrement) -
StringAsyncEntityConsumer
-
StringAsyncEntityConsumer
public StringAsyncEntityConsumer()
-
-
Method Details
-
streamStart
Description copied from class:AbstractCharAsyncEntityConsumerTriggered to signal beginning of entity content stream.- Specified by:
streamStartin classAbstractCharAsyncEntityConsumer<String>- Parameters:
contentType- the entity content type- Throws:
HttpExceptionIOException
-
capacityIncrement
protected int capacityIncrement()Description copied from class:AbstractCharDataConsumerTriggered to obtain the capacity increment.- Specified by:
capacityIncrementin classAbstractCharDataConsumer- Returns:
- the number of bytes this consumer is prepared to process.
-
data
Description copied from class:AbstractCharDataConsumerTriggered to pass incoming data packet to the data consumer.- Specified by:
datain classAbstractCharDataConsumer- Parameters:
src- the data packet.endOfStream- flag indicating whether this data packet is the last in the data stream.
-
generateContent
Description copied from class:AbstractCharAsyncEntityConsumerTriggered to generate entity representation.- Specified by:
generateContentin classAbstractCharAsyncEntityConsumer<String>- Returns:
- the entity content
-
releaseResources
public void releaseResources()
-