public class StringAsyncEntityProducer extends AbstractCharAsyncEntityProducer
AsyncDataProducer implementation that
generates data stream from content of a string.| 构造器和说明 |
|---|
StringAsyncEntityProducer(CharSequence content) |
StringAsyncEntityProducer(CharSequence content,
ContentType contentType) |
StringAsyncEntityProducer(CharSequence content,
int bufferSize,
ContentType contentType) |
StringAsyncEntityProducer(CharSequence content,
int bufferSize,
int fragmentSizeHint,
ContentType contentType) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在类中 AbstractCharAsyncEntityProducerprotected void produceData(StreamChannel<CharBuffer> channel) throws IOException
AbstractCharAsyncEntityProducer
StreamChannel passed to this method is threading-safe.
produceData 在类中 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 在接口中 ResourceHolderreleaseResources 在类中 AbstractCharAsyncEntityProducerCopyright © 2023. All rights reserved.