Class CharSequenceAsyncEntityConsumer<T>
- java.lang.Object
-
- org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
-
- org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer<T>
-
- org.apache.hc.core5.http.nio.entity.CharSequenceAsyncEntityConsumer<T>
-
- All Implemented Interfaces:
AsyncDataConsumer,AsyncEntityConsumer<T>,ResourceHolder
- Direct Known Subclasses:
StringAsyncEntityConsumer
public class CharSequenceAsyncEntityConsumer<T> extends AbstractCharAsyncEntityConsumer<T>
AsyncEntityConsumerimplementation that processes the data stream content into aCharSequence.- Since:
- 5.5
-
-
Field Summary
-
Fields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
DEF_BUF_SIZE
-
-
Constructor Summary
Constructors Constructor Description CharSequenceAsyncEntityConsumer(int bufSize, int capacityIncrement, CharCodingConfig charCodingConfig, java.util.function.Function<java.lang.CharSequence,T> transformation)CharSequenceAsyncEntityConsumer(int capacityIncrement, java.util.function.Function<java.lang.CharSequence,T> transformation)CharSequenceAsyncEntityConsumer(java.util.function.Function<java.lang.CharSequence,T> transformation)CharSequenceAsyncEntityConsumer(CharCodingConfig charCodingConfig, java.util.function.Function<java.lang.CharSequence,T> transformation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcapacityIncrement()Triggered to obtain the capacity increment.protected voiddata(java.nio.CharBuffer src, boolean endOfStream)Triggered to pass incoming data packet to the data consumer.TgenerateContent()Triggered to generate entity representation.voidreleaseResources()protected 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, streamStart
-
Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
consume, setCharset, streamEnd, updateCapacity
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer
consume, streamEnd, updateCapacity
-
-
-
-
Constructor Detail
-
CharSequenceAsyncEntityConsumer
public CharSequenceAsyncEntityConsumer(int bufSize, int capacityIncrement, CharCodingConfig charCodingConfig, java.util.function.Function<java.lang.CharSequence,T> transformation)
-
CharSequenceAsyncEntityConsumer
public CharSequenceAsyncEntityConsumer(int capacityIncrement, java.util.function.Function<java.lang.CharSequence,T> transformation)
-
CharSequenceAsyncEntityConsumer
public CharSequenceAsyncEntityConsumer(CharCodingConfig charCodingConfig, java.util.function.Function<java.lang.CharSequence,T> transformation)
-
CharSequenceAsyncEntityConsumer
public CharSequenceAsyncEntityConsumer(java.util.function.Function<java.lang.CharSequence,T> transformation)
-
-
Method Detail
-
streamStart
protected final void streamStart(ContentType contentType) throws HttpException, java.io.IOException
Description copied from class:AbstractCharAsyncEntityConsumerTriggered to signal beginning of entity content stream.- Specified by:
streamStartin classAbstractCharAsyncEntityConsumer<T>- Parameters:
contentType- the entity content type- Throws:
HttpException- in case of an HTTP protocol violation.java.io.IOException- in case of an I/O error.
-
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
protected final void data(java.nio.CharBuffer src, boolean endOfStream)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
public T generateContent()
Description copied from class:AbstractCharAsyncEntityConsumerTriggered to generate entity representation.- Specified by:
generateContentin classAbstractCharAsyncEntityConsumer<T>- Returns:
- the entity content
-
releaseResources
public void releaseResources()
-
-