Table of Contents

Class ByteBufferStream

Namespace
MongoDB.Bson.IO
Assembly
MongoDB.Bson.dll

Represents a Stream backed by an IByteBuffer. Similar to MemoryStream but backed by an IByteBuffer instead of a byte array and also implements the BsonStream interface for higher performance BSON I/O.

public class ByteBufferStream : BsonStream, IDisposable, IStreamEfficientCopyTo
Inheritance
ByteBufferStream
Implements
Inherited Members
Extension Methods

Constructors

ByteBufferStream(IByteBuffer, bool)

Initializes a new instance of the ByteBufferStream class.

Properties

Buffer

Gets the buffer.

CanRead
CanSeek
CanTimeout
CanWrite
Length
Position

Methods

Dispose(bool)
EfficientCopyTo(Stream)

Copy the current stream to the destination without making unnecessary copies of the bytes.

Flush()
Read(byte[], int, int)
ReadByte()
ReadCString(UTF8Encoding)

Reads a BSON CString from the stream.

ReadCStringBytes()

Reads a BSON CString from the stream.

ReadDecimal128()

Reads a BSON Decimal128 from the stream.

ReadDouble()

Reads a BSON double from the stream.

ReadInt32()

Reads a 32-bit BSON integer from the stream.

ReadInt64()

Reads a 64-bit BSON integer from the stream.

ReadObjectId()

Reads a BSON ObjectId from the stream.

ReadSlice()

Reads a raw length prefixed slice from the stream.

ReadString(UTF8Encoding)

Reads a BSON string from the stream.

Seek(long, SeekOrigin)
SetLength(long)
SkipCString()

Skips over a BSON CString leaving the stream positioned just after the terminating null byte.

Write(byte[], int, int)
WriteByte(byte)
WriteCString(string)

Writes a BSON CString to the stream.

WriteCStringBytes(byte[])

Writes the CString bytes to the stream.

WriteDecimal128(Decimal128)

Writes a BSON Decimal128 to the stream.

WriteDouble(double)

Writes a BSON double to the stream.

WriteInt32(int)

Writes a 32-bit BSON integer to the stream.

WriteInt64(long)

Writes a 64-bit BSON integer to the stream.

WriteObjectId(ObjectId)

Writes a BSON ObjectId to the stream.

WriteString(string, UTF8Encoding)

Writes a BSON string to the stream.