IByteBuffer InterfaceMongoDB C# Driver API Documentation
Represents a byte buffer (backed by various means depending on the implementation).

Namespace: MongoDB.Bson.IO
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: { version: '1.11.0.92', semver: '1.11.0', commit: '791a16588d4a8b3b118a8b3b57cfa436fec5d3da', commitDate: '2015-12-08 22:55:45' }
Syntax

public interface IByteBuffer : IDisposable

The IByteBuffer type exposes the following members.

Methods

  NameDescription
Public methodClear
Clears this instance.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Public methodFindNullByte
Finds the next null byte.
Public methodGetSlice
Gets a slice of this buffer.
Public methodLoadFrom
Loads the buffer from a stream.
Public methodMakeReadOnly
Makes this buffer read only.
Public methodReadBackingBytes
Read directly from the backing bytes. The returned ArraySegment points directly to the backing bytes for the current position and you can read the bytes directly from there. If the backing bytes happen to span a chunk boundary shortly after the current position there might not be enough bytes left in the current chunk in which case the returned ArraySegment will have a Count of zero and you should call ReadBytes instead. When ReadBackingBytes returns the position will have been advanced by count bytes *if and only if* there were count bytes left in the current chunk.
Public methodReadByte
Reads a byte.
Public methodReadBytes(Int32)
Reads bytes.
Public methodReadBytes(Byte, Int32, Int32)
Reads bytes.
Public methodWriteBackingBytes
Write directly to the backing bytes. The returned ArraySegment points directly to the backing bytes for the current position and you can write the bytes directly to there. If the backing bytes happen to span a chunk boundary shortly after the current position there might not be enough bytes left in the current chunk in which case the returned ArraySegment will have a Count of zero and you should call WriteBytes instead. When WriteBackingBytes returns the position has not been advanced. After you have written up to count bytes directly to the backing bytes advance the position by the number of bytes actually written.
Public methodWriteByte
Writes a byte.
Public methodWriteBytes(Byte)
Writes bytes.
Public methodWriteBytes(IByteBuffer)
Writes bytes.
Public methodWriteTo
Writes Length bytes from this buffer starting at Position 0 to a stream.
Top
Properties

  NameDescription
Public propertyCapacity
Gets or sets the capacity.
Public propertyIsReadOnly
Gets a value indicating whether this instance is read only.
Public propertyLength
Gets or sets the length.
Public propertyPosition
Gets or sets the position.
Top
See Also

Reference