Interface GridFSDownloadPublisher
-
- All Superinterfaces:
org.reactivestreams.Publisher<ByteBuffer>
public interface GridFSDownloadPublisher extends org.reactivestreams.Publisher<ByteBuffer>
A GridFS Publisher for downloading data from GridFSProvides the
GridFSFile
for the file to being downloaded as well as a way to control the batchsize.- Since:
- 1.13
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GridFSDownloadPublisher
bufferSizeBytes(int bufferSizeBytes)
The preferred number of bytes perByteBuffer
returned by thePublisher
.org.reactivestreams.Publisher<GridFSFile>
getGridFSFile()
Gets the correspondingGridFSFile
for the file being downloaded
-
-
-
Method Detail
-
getGridFSFile
org.reactivestreams.Publisher<GridFSFile> getGridFSFile()
Gets the correspondingGridFSFile
for the file being downloaded- Returns:
- a Publisher with a single element, the corresponding GridFSFile for the file being downloaded
-
bufferSizeBytes
GridFSDownloadPublisher bufferSizeBytes(int bufferSizeBytes)
The preferred number of bytes perByteBuffer
returned by thePublisher
.Allows for larger than chunk size ByteBuffers. The actual chunk size of the data stored in MongoDB is the smallest allowable
ByteBuffer
size.Can be used to control the memory consumption of this
Publisher
. The smaller the bufferSizeBytes the lower the memory consumption and higher latency.Note: Must be set before the Publisher is subscribed to.
- Parameters:
bufferSizeBytes
- the preferred buffer size in bytes to use perByteBuffer
in thePublisher
, defaults to chunk size.- Returns:
- this
-
-