public class InputStreamAsyncContentProvider extends AbstractAsyncContentProvider
AsyncContentProvider that gets the reads from an InputStream.AbstractAsyncContentProvider.OnlyProcessedHandlingAsyncContentListener| Constructor and Description |
|---|
InputStreamAsyncContentProvider(InputStream in,
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 InputStreamAsyncContentProvider(InputStream in, Optional<Long> contentLength, Optional<MediaType> contentType, int bufferSize)
in - The wrapped input stream where the data is consumed from.contentLength - The amount of data that can be read from the input stream if known.contentType - The content type of the data that can be read from the input stream if known.bufferSize - The size of the buffer that is used to read from the input stream.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.