Closeable
, Flushable
, AutoCloseable
@NotThreadSafe public abstract class GridFSUploadStream extends OutputStream
Provides the id
for the file to be uploaded as well as the write
methods of a OutputStream
This implementation of a OutputStream
will not throw IOException
s. However, it will throw a
MongoException
if there is an error writing to MongoDB.
Constructor | Description |
---|---|
GridFSUploadStreamβ() |
Modifier and Type | Method | Description |
---|---|---|
abstract void |
abortβ() |
Aborts the upload and deletes any data.
|
abstract void |
closeβ() |
|
void |
flushβ() |
|
abstract ObjectId |
getFileIdβ() |
Deprecated.
use
getObjectId() instead. |
abstract BsonValue |
getIdβ() |
Gets the
BsonValue for the file to be uploaded |
abstract ObjectId |
getObjectIdβ() |
Gets the
ObjectId for the file to be uploaded or throws an error if an alternative BsonType has been used for the id. |
abstract void |
writeβ(byte[] b) |
|
abstract void |
writeβ(byte[] b,
int off,
int len) |
|
abstract void |
writeβ(int b) |
@Deprecated public abstract ObjectId getFileIdβ()
getObjectId()
instead.ObjectId
for the file to be uploaded
Throws a MongoGridFSException
if the file id is not an ObjectId.public abstract ObjectId getObjectIdβ()
ObjectId
for the file to be uploaded or throws an error if an alternative BsonType has been used for the id.
Throws a MongoGridFSException if the file id is not an ObjectId.public abstract BsonValue getIdβ()
BsonValue
for the file to be uploadedpublic abstract void abortβ()
public abstract void writeβ(int b)
write
in class OutputStream
public abstract void writeβ(byte[] b)
write
in class OutputStream
public abstract void writeβ(byte[] b, int off, int len)
write
in class OutputStream
public void flushβ()
flush
in interface Flushable
flush
in class OutputStream
public abstract void closeβ()
close
in interface AutoCloseable
close
in interface Closeable
close
in class OutputStream