@NotThreadSafe public abstract class GridFSUploadStream extends java.io.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 IOExceptions. However, it will throw a
MongoException if there is an error writing to MongoDB.
| 构造器和说明 |
|---|
GridFSUploadStream() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
abort()
Aborts the upload and deletes any data.
|
abstract void |
close() |
void |
flush() |
abstract ObjectId |
getFileId()
已过时。
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 在类中 java.io.OutputStreampublic abstract void write(byte[] b)
write 在类中 java.io.OutputStreampublic abstract void write(byte[] b,
int off,
int len)
write 在类中 java.io.OutputStreampublic void flush()
flush 在接口中 java.io.Flushableflush 在类中 java.io.OutputStreampublic abstract void close()
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableclose 在类中 java.io.OutputStream