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

public Class BasicAsyncEntityConsumer

extends AbstractBinAsyncEntityConsumer<byte[]>
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, org.apache.hc.core5.http.ContentType, .HttpException, org.apache.hc.core5.util.ByteArrayBuffer

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

Field Summary

Modifier and TypeField and Description
private final ByteArrayBuffer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected int
capacityIncrement()

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

Triggered to obtain the capacity increment.
protected void
data(final ByteBuffer
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.AbstractBinDataConsumer.data.

Triggered to pass incoming data packet to the data consumer.
protected byte[]
generateContent()

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

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

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

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

Field Detail

bufferback to summary
private final ByteArrayBuffer buffer

Constructor Detail

BasicAsyncEntityConsumerback to summary
public BasicAsyncEntityConsumer()

Method Detail

capacityIncrementback to summary
protected int capacityIncrement()

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

Doc from org.apache.hc.core5.http.nio.entity.AbstractBinDataConsumer.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 void data(final ByteBuffer src, final boolean endOfStream) throws IOException

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

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

Triggered to pass incoming data packet to the data consumer.

Parameters
src:ByteBuffer

the data packet.

endOfStream:boolean

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

Annotations
@Override
generateContentback to summary
protected byte[] generateContent() throws IOException

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

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

Triggered to generate entity representation.

Returns:byte[]

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 void streamStart(final ContentType contentType) throws HttpException, IOException

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

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

Triggered to signal beginning of entity content stream.

Parameters
contentType:ContentType

the entity content type

Annotations
@Override