@Contract(threading=SAFE_CONDITIONAL) public abstract class AbstractCharAsyncEntityProducer extends Object implements AsyncEntityProducer
Constructor and Description |
---|
AbstractCharAsyncEntityProducer(int bufferSize,
int fragmentSizeHint,
ContentType contentType) |
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the number of bytes immediately available for output.
|
protected abstract int |
availableData()
Returns the number of bytes immediately available for output.
|
String |
getContentEncoding()
Returns content encoding of the entity, if known.
|
long |
getContentLength()
Returns length of the entity, if known.
|
String |
getContentType()
Returns content type of the entity, if known.
|
Set<String> |
getTrailerNames()
Preliminary declaration of trailing headers.
|
boolean |
isChunked()
Returns chunked transfer hint for this entity.
|
void |
produce(DataStreamChannel channel)
Triggered to signal the ability of the underlying data channel
to accept more data.
|
protected abstract void |
produceData(StreamChannel<CharBuffer> channel)
Triggered to signal the ability of the underlying char channel
to accept more data.
|
void |
releaseResources() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
failed, isRepeatable
public AbstractCharAsyncEntityProducer(int bufferSize, int fragmentSizeHint, ContentType contentType)
protected abstract int availableData()
protected abstract void produceData(StreamChannel<CharBuffer> channel) throws IOException
StreamChannel
passed to this method is threading-safe.
channel
- the data channel capable to accepting more data.IOException
public final String getContentType()
EntityDetails
getContentType
in interface EntityDetails
public String getContentEncoding()
EntityDetails
getContentEncoding
in interface EntityDetails
public long getContentLength()
EntityDetails
getContentLength
in interface EntityDetails
public boolean isChunked()
EntityDetails
The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.
isChunked
in interface EntityDetails
public Set<String> getTrailerNames()
EntityDetails
getTrailerNames
in interface EntityDetails
public final int available()
AsyncDataProducer
available
in interface AsyncDataProducer
public final void produce(DataStreamChannel channel) throws IOException
AsyncDataProducer
produce
in interface AsyncDataProducer
channel
- the data channel capable to accepting more data.IOException
public void releaseResources()
releaseResources
in interface ResourceHolder
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.