Table of Contents

Class MongoGridFSStream

Namespace
MongoDB.Driver.GridFS
Assembly
MongoDB.Driver.Legacy.dll

Represents a stream interface to a GridFS file (patterned after .NET's Stream class).

public class MongoGridFSStream : Stream, IDisposable
Inheritance
MongoGridFSStream
Implements
Inherited Members
Extension Methods

Constructors

MongoGridFSStream(MongoGridFSFileInfo, FileMode)

Initializes a new instance of the MongoGridFSStream class.

MongoGridFSStream(MongoGridFSFileInfo, FileMode, FileAccess)

Initializes a new instance of the MongoGridFSStream class.

Properties

CanRead

Gets whether the GridFS stream supports reading.

CanSeek

Gets whether the GridFS stream supports seeking.

CanWrite

Gets whether the GridFS stream supports writing.

Length

Gets the current length (use SetLength to change the length).

Position

Gets or sets the current position.

UpdateMD5

Gets or sets a value indicating whether to compute and update the MD5 hash for the file when the stream is closed.

Methods

Dispose(bool)

Disposes of any resources used by the stream.

Flush()

Flushes any unsaved data in the buffers to the GridFS file.

Read(byte[], int, int)

Reads bytes from the GridFS stream.

ReadByte()

Reads one byte from the GridFS stream.

Seek(long, SeekOrigin)

Seeks to a new position.

SetLength(long)

Sets the length of the GridFS file.

Write(byte[], int, int)

Writes bytes to the GridFS stream.

WriteByte(byte)

Writes one byte to the GridFS stream.