Top Description Fields Constructors Methods
org.apache.hc.core5.http.nio.entity

public Class StringAsyncEntityConsumer

extends AbstractCharAsyncEntityConsumer<String>
Class Inheritance
Imports
java.io.IOException, java.nio.CharBuffer, org.apache.hc.core5.http.ContentType, .HttpException, org.apache.hc.core5.http.config.CharCodingConfig, org.apache.hc.core5.util.Args, .CharArrayBuffer

Basic org.apache.hc.core5.http.nio.AsyncEntityConsumer implementation that processes the data stream content into a string.
Since
5.0

Field Summary

Modifier and TypeField and Description
private final int
private final CharArrayBuffer

Constructor Summary

AccessConstructor and Description
public
StringAsyncEntityConsumer(final int bufSize, final int capacityIncrement, final CharCodingConfig charCodingConfig)

public
StringAsyncEntityConsumer(final int capacityIncrement)

public
public

Method Summary

Modifier and TypeMethod and Description
protected int
capacityIncrement()

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.capacityIncrement.

Triggered to obtain the capacity increment.
protected final void
data(final CharBuffer
the data packet.
src
,
final boolean
flag indicating whether this data packet is the last in the data stream.
endOfStream
)

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.data.

Triggered to pass incoming data packet to the data consumer.
public String
generateContent()

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.generateContent.

Triggered to generate entity representation.
public void
protected final void
streamStart(final ContentType
the entity content type
contentType
)

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.streamStart.

Triggered to signal beginning of entity content stream.
Inherited from org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer:
completedfailedgetContentstreamStart

Field Detail

capacityIncrementback to summary
private final int capacityIncrement
contentback to summary
private final CharArrayBuffer content

Hides org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.content.

Constructor Detail

StringAsyncEntityConsumerback to summary
public StringAsyncEntityConsumer(final int bufSize, final int capacityIncrement, final CharCodingConfig charCodingConfig)
StringAsyncEntityConsumerback to summary
public StringAsyncEntityConsumer(final int capacityIncrement)
StringAsyncEntityConsumerback to summary
public StringAsyncEntityConsumer(final CharCodingConfig charCodingConfig)
StringAsyncEntityConsumerback to summary
public StringAsyncEntityConsumer()

Method Detail

capacityIncrementback to summary
protected int capacityIncrement()

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.capacityIncrement.

Doc from org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.capacityIncrement.

Triggered to obtain the capacity increment.

Returns:int

the number of bytes this consumer is prepared to process.

Annotations
@Override
databack to summary
protected final void data(final CharBuffer src, final boolean endOfStream)

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.data.

Doc from org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.data.

Triggered to pass incoming data packet to the data consumer.

Parameters
src:CharBuffer

the data packet.

endOfStream:boolean

flag indicating whether this data packet is the last in the data stream.

Annotations
@Override
generateContentback to summary
public String generateContent()

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.generateContent.

Doc from org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.generateContent.

Triggered to generate entity representation.

Returns:String

the entity content

Annotations
@Override
releaseResourcesback to summary
public void releaseResources()

Implements org.apache.hc.core5.http.nio.ResourceHolder.releaseResources.

Annotations
@Override
streamStartback to summary
protected final void streamStart(final ContentType contentType) throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.streamStart.

Doc from org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer.streamStart.

Triggered to signal beginning of entity content stream.

Parameters
contentType:ContentType

the entity content type

Annotations
@Override