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

public abstract Class AbstractBinDataConsumer

extends Object
implements AsyncDataConsumer
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.ResourceHolder
Known Direct Subclasses
org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityConsumer
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.List, org.apache.hc.core5.http.Header, .HttpException, org.apache.hc.core5.http.nio.AsyncDataConsumer, .CapacityChannel

Abstract binary data consumer.
Since
5.0

Field Summary

Modifier and TypeField and Description
private static final ByteBuffer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract int

Returns:

the number of bytes this consumer is prepared to process.
capacityIncrement
()

Triggered to obtain the capacity increment.

protected abstract void
completed()

Triggered to signal completion of data processing.

public final void
consume(final ByteBuffer
data source.
src
)

Implements org.apache.hc.core5.http.nio.AsyncDataConsumer.consume.

Triggered to pass incoming data to the data consumer.
protected abstract void
data(ByteBuffer
the data packet.
src
,
boolean
flag indicating whether this data packet is the last in the data stream.
endOfStream
)

Triggered to pass incoming data packet to the data consumer.

public final void
streamEnd(final List<? extends Header>
data stream trailers.
trailers
)

Implements org.apache.hc.core5.http.nio.AsyncDataConsumer.streamEnd.

Triggered to signal termination of the data stream.
public final void
updateCapacity(final CapacityChannel
the channel for capacity updates.
capacityChannel
)

Implements org.apache.hc.core5.http.nio.AsyncDataConsumer.updateCapacity.

Triggered to signal ability of the underlying data stream to receive data capacity update.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
private static final ByteBuffer EMPTY

Constructor Detail

AbstractBinDataConsumerback to summary
public AbstractBinDataConsumer()

Method Detail

capacityIncrementback to summary
protected abstract int capacityIncrement()

Triggered to obtain the capacity increment.

Returns:int

the number of bytes this consumer is prepared to process.

completedback to summary
protected abstract void completed() throws IOException

Triggered to signal completion of data processing.

consumeback to summary
public final void consume(final ByteBuffer src) throws IOException

Implements org.apache.hc.core5.http.nio.AsyncDataConsumer.consume.

Doc from org.apache.hc.core5.http.nio.AsyncDataConsumer.consume.

Triggered to pass incoming data to the data consumer. The consumer must consume the entire content of the data buffer. The consumer must stop incrementing its capacity on the capacity channel if it is unable to accept more data. Once the data consumer has handled accumulated data or allocated more intermediate storage it can update its capacity information on the capacity channel.

Parameters
src:ByteBuffer

data source.

Annotations
@Override
databack to summary
protected abstract void data(ByteBuffer src, boolean endOfStream) throws IOException

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.

streamEndback to summary
public final void streamEnd(final List<? extends Header> trailers) throws HttpException, IOException

Implements org.apache.hc.core5.http.nio.AsyncDataConsumer.streamEnd.

Doc from org.apache.hc.core5.http.nio.AsyncDataConsumer.streamEnd.

Triggered to signal termination of the data stream.

Parameters
trailers:List<? extends Header>

data stream trailers.

Annotations
@Override
updateCapacityback to summary
public final void updateCapacity(final CapacityChannel capacityChannel) throws IOException

Implements org.apache.hc.core5.http.nio.AsyncDataConsumer.updateCapacity.

Doc from org.apache.hc.core5.http.nio.AsyncDataConsumer.updateCapacity.

Triggered to signal ability of the underlying data stream to receive data capacity update. The data consumer can choose to write data immediately inside the call or asynchronously at some later point.

Parameters
capacityChannel:CapacityChannel

the channel for capacity updates.

Annotations
@Override