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

public abstract Class AbstractBinAsyncEntityProducer

extends Object
implements AsyncEntityProducer
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.AsyncEntityProducer, org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.nio.AsyncDataProducer, org.apache.hc.core5.http.nio.ResourceHolder
Annotations
@Contract
threading:SAFE_CONDITIONAL
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.Set, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.ContentType, org.apache.hc.core5.http.nio.AsyncEntityProducer, .DataStreamChannel, .StreamChannel, org.apache.hc.core5.util.Args

Abstract binary entity content producer.
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final ContentType
private final int
private volatile AbstractBinAsyncEntityProducer.State

Constructor Summary

AccessConstructor and Description
public
AbstractBinAsyncEntityProducer(final int fragmentSizeHint, final ContentType contentType)

Method Summary

Modifier and TypeMethod and Description
public final int
available()

Implements org.apache.hc.core5.http.nio.AsyncDataProducer.available.

Returns the number of bytes immediately available for output.
protected abstract int

Returns:

the number of bytes immediately available for output
availableData
()

Returns the number of bytes immediately available for output.

private void
flush(final StreamChannel<ByteBuffer> channel)

public String
getContentEncoding()

Implements org.apache.hc.core5.http.EntityDetails.getContentEncoding.

Returns content encoding of the entity, if known.
public long
getContentLength()

Implements org.apache.hc.core5.http.EntityDetails.getContentLength.

Returns length of the entity, if known.
public final String
getContentType()

Implements org.apache.hc.core5.http.EntityDetails.getContentType.

Returns content type of the entity, if known.
public Set<String>
getTrailerNames()

Implements org.apache.hc.core5.http.EntityDetails.getTrailerNames.

Preliminary declaration of trailing headers.
public boolean
isChunked()

Implements org.apache.hc.core5.http.EntityDetails.isChunked.

Returns chunked transfer hint for this entity.
public final void
produce(final DataStreamChannel
the data channel capable to accepting more data.
channel
)

Implements org.apache.hc.core5.http.nio.AsyncDataProducer.produce.

Triggered to signal the ability of the underlying data channel to accept more data.
protected abstract void
produceData(StreamChannel<ByteBuffer>
the data channel capable to accepting more data.
channel
)

Triggered to signal the ability of the underlying byte channel to accept more data.

public void
pack-priv final void
pack-priv final int
writeData(final StreamChannel<ByteBuffer> channel, final ByteBuffer src)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byteBufferback to summary
private final ByteBuffer byteBuffer
contentTypeback to summary
private final ContentType contentType
fragmentSizeHintback to summary
private final int fragmentSizeHint
stateback to summary
private volatile AbstractBinAsyncEntityProducer.State state

Constructor Detail

AbstractBinAsyncEntityProducerback to summary
public AbstractBinAsyncEntityProducer(final int fragmentSizeHint, final ContentType contentType)

Method Detail

availableback to summary
public final int available()

Implements org.apache.hc.core5.http.nio.AsyncDataProducer.available.

Doc from org.apache.hc.core5.http.nio.AsyncDataProducer.available.

Returns the number of bytes immediately available for output. This method can be used as a hint to control output events of the underlying I/O session.

Returns:int

the number of bytes immediately available for output

Annotations
@Override
availableDataback to summary
protected abstract int availableData()

Returns the number of bytes immediately available for output. This method can be used as a hint to control output events of the underlying I/O session.

Returns:int

the number of bytes immediately available for output

flushback to summary
private void flush(final StreamChannel<ByteBuffer> channel) throws IOException
getContentEncodingback to summary
public String getContentEncoding()

Implements org.apache.hc.core5.http.EntityDetails.getContentEncoding.

Doc from org.apache.hc.core5.http.EntityDetails.getContentEncoding.

Returns content encoding of the entity, if known.

Annotations
@Override
getContentLengthback to summary
public long getContentLength()

Implements org.apache.hc.core5.http.EntityDetails.getContentLength.

Doc from org.apache.hc.core5.http.EntityDetails.getContentLength.

Returns length of the entity, if known.

Annotations
@Override
getContentTypeback to summary
public final String getContentType()

Implements org.apache.hc.core5.http.EntityDetails.getContentType.

Doc from org.apache.hc.core5.http.EntityDetails.getContentType.

Returns content type of the entity, if known.

Annotations
@Override
getTrailerNamesback to summary
public Set<String> getTrailerNames()

Implements org.apache.hc.core5.http.EntityDetails.getTrailerNames.

Doc from org.apache.hc.core5.http.EntityDetails.getTrailerNames.

Preliminary declaration of trailing headers.

Annotations
@Override
isChunkedback to summary
public boolean isChunked()

Implements org.apache.hc.core5.http.EntityDetails.isChunked.

Doc from org.apache.hc.core5.http.EntityDetails.isChunked.

Returns chunked transfer hint for this entity.

The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.

Annotations
@Override
produceback to summary
public final void produce(final DataStreamChannel channel) throws IOException

Implements org.apache.hc.core5.http.nio.AsyncDataProducer.produce.

Doc from org.apache.hc.core5.http.nio.AsyncDataProducer.produce.

Triggered to signal the ability of the underlying data channel to accept more data. The data producer can choose to write data immediately inside the call or asynchronously at some later point.

Parameters
channel:DataStreamChannel

the data channel capable to accepting more data.

Annotations
@Override
produceDataback to summary
protected abstract void produceData(StreamChannel<ByteBuffer> channel) throws IOException

Triggered to signal the ability of the underlying byte channel to accept more data. The data producer can choose to write data immediately inside the call or asynchronously at some later point.

StreamChannel passed to this method is threading-safe.

Parameters
channel:StreamChannel<ByteBuffer>

the data channel capable to accepting more data.

releaseResourcesback to summary
public void releaseResources()

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

Annotations
@Override
streamEndback to summary
pack-priv final void streamEnd(final StreamChannel<ByteBuffer> channel) throws IOException
writeDataback to summary
pack-priv final int writeData(final StreamChannel<ByteBuffer> channel, final ByteBuffer src) throws IOException
org.apache.hc.core5.http.nio.entity back to summary

pack-priv final Enum AbstractBinAsyncEntityProducer.State

extends Enum<AbstractBinAsyncEntityProducer.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final AbstractBinAsyncEntityProducer.State
public static final AbstractBinAsyncEntityProducer.State
public static final AbstractBinAsyncEntityProducer.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AbstractBinAsyncEntityProducer.State
public static AbstractBinAsyncEntityProducer.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ACTIVEback to summary
public static final AbstractBinAsyncEntityProducer.State ACTIVE
END_STREAMback to summary
public static final AbstractBinAsyncEntityProducer.State END_STREAM
FLUSHINGback to summary
public static final AbstractBinAsyncEntityProducer.State FLUSHING

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static AbstractBinAsyncEntityProducer.State valueOf(String name)
valuesback to summary
public static AbstractBinAsyncEntityProducer.State[] values()