public class StringAsyncEntityProducer extends AbstractCharAsyncEntityProducer
AsyncDataProducer implementation that
generates data stream from content of a string.| Constructor and Description |
|---|
StringAsyncEntityProducer(CharSequence content) |
StringAsyncEntityProducer(CharSequence content,
ContentType contentType) |
StringAsyncEntityProducer(CharSequence content,
int bufferSize,
ContentType contentType) |
StringAsyncEntityProducer(CharSequence content,
int bufferSize,
int fragmentSizeHint,
ContentType contentType) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
availableData()
Returns the number of bytes immediately available for output.
|
void |
failed(Exception cause)
Triggered to signal a failure in data generation.
|
Exception |
getException() |
boolean |
isRepeatable()
Determines whether the producer can consistently produce the same content
after invocation of
ResourceHolder.releaseResources(). |
protected void |
produceData(StreamChannel<CharBuffer> channel)
Triggered to signal the ability of the underlying char channel
to accept more data.
|
void |
releaseResources() |
available, getContentEncoding, getContentLength, getContentType, getTrailerNames, isChunked, producepublic StringAsyncEntityProducer(CharSequence content, int bufferSize, int fragmentSizeHint, ContentType contentType)
public StringAsyncEntityProducer(CharSequence content, int bufferSize, ContentType contentType)
public StringAsyncEntityProducer(CharSequence content, ContentType contentType)
public StringAsyncEntityProducer(CharSequence content)
public boolean isRepeatable()
AsyncEntityProducerResourceHolder.releaseResources().protected int availableData()
AbstractCharAsyncEntityProduceravailableData in class AbstractCharAsyncEntityProducerprotected void produceData(StreamChannel<CharBuffer> channel) throws IOException
AbstractCharAsyncEntityProducer
StreamChannel passed to this method is threading-safe.
produceData in class AbstractCharAsyncEntityProducerchannel - the data channel capable to accepting more data.IOExceptionpublic void failed(Exception cause)
AsyncEntityProducercause - the cause of the failure.public Exception getException()
public void releaseResources()
releaseResources in interface ResourceHolderreleaseResources in class AbstractCharAsyncEntityProducerCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.