@NotThreadSafe public abstract class GridFSDownloadStream extends java.io.InputStream
Provides the GridFSFile
for the file to being downloaded as well as the read
methods of a InputStream
This implementation of a InputStream
will not throw IOException
s. However, it will throw a
MongoException
if there is an error reading from MongoDB.
Constructor and Description |
---|
GridFSDownloadStream() |
Modifier and Type | Method and Description |
---|---|
abstract int |
available() |
abstract GridFSDownloadStream |
batchSize(int batchSize)
Sets the number of chunks to return per batch.
|
abstract void |
close() |
abstract GridFSFile |
getGridFSFile()
Gets the corresponding
GridFSFile for the file being downloaded |
abstract void |
mark()
Marks the current position in this input stream.
|
abstract int |
read() |
abstract int |
read(byte[] b) |
abstract int |
read(byte[] b,
int off,
int len) |
abstract void |
reset() |
abstract long |
skip(long n) |
public abstract GridFSFile getGridFSFile()
GridFSFile
for the file being downloadedpublic abstract GridFSDownloadStream batchSize(int batchSize)
Can be used to control the memory consumption of this InputStream. The smaller the batchSize the lower the memory consumption and higher latency.
batchSize
- the batch sizepublic abstract int read()
read
in class java.io.InputStream
public abstract int read(byte[] b)
read
in class java.io.InputStream
public abstract int read(byte[] b, int off, int len)
read
in class java.io.InputStream
public abstract long skip(long n)
skip
in class java.io.InputStream
public abstract int available()
available
in class java.io.InputStream
public abstract void mark()
A subsequent call to the reset
method repositions this stream at the last marked position so that subsequent reads
re-read the same bytes.
public abstract void reset()
reset
in class java.io.InputStream
public abstract void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream