public class ByteArrayAsyncContentProvider extends AbstractAsyncContentProvider
AsyncContentProvider that wraps a byte array and provides it as one
chunk.AbstractAsyncContentProvider.OnlyProcessedHandlingAsyncContentListener| Constructor and Description |
|---|
ByteArrayAsyncContentProvider(byte[] content,
Optional<MediaType> contentType) |
| 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, onSuccessprotected 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.