public class ReadableByteChannelAsyncContentProvider extends AbstractAsyncContentProvider
AsyncContentProvider that gets the reads from a
ReadableByteChannel.AbstractAsyncContentProvider.OnlyProcessedHandlingAsyncContentListener| Constructor and Description |
|---|
ReadableByteChannelAsyncContentProvider(ReadableByteChannel byteChannel,
Optional<Long> contentLength,
Optional<MediaType> contentType,
int bufferSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doClose() |
Optional<Long> |
getContentLength()
The size of the data that is provided or
Optional.empty() if the length is unknown in
advance. |
Optional<MediaType> |
getContentType()
The media type of the content or
Optional.empty() if the media type is unknown. |
protected void |
provideNextChunk(Consumer<ByteBuffer> callback) |
close, getFailure, handleErrorFromInput, handleSuccess, isClosed, onContent, onError, onSuccesspublic ReadableByteChannelAsyncContentProvider(ReadableByteChannel byteChannel, Optional<Long> contentLength, Optional<MediaType> contentType, int bufferSize)
byteChannel - The wrapped byte channel where the data is consumed from.contentLength - The amount of data that can be read from the byte channel if known.contentType - The content type of the data that can be read from the byte channel if known.bufferSize - The size of the buffer that is used to read from the byte channel.protected void doClose()
doClose in class AbstractAsyncContentProviderpublic Optional<Long> getContentLength()
AsyncContentProviderOptional.empty() if the length is unknown in
advance.public Optional<MediaType> getContentType()
AsyncContentProviderOptional.empty() if the media type is unknown.protected void provideNextChunk(Consumer<ByteBuffer> callback)
provideNextChunk in class AbstractAsyncContentProviderCopyright © 2011–2019 Everit Kft.. All rights reserved.