C# Класс MongoDB.Bson.IO.MultiChunkBuffer

An IBsonBuffer that has multiple chunks.
Наследование: IByteBuffer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Clear ( ) : void

Clears this instance.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FindNullByte ( ) : int

Finds the next null byte.

GetSlice ( int position, int length ) : IByteBuffer

Gets a slice of this buffer.

LoadFrom ( Stream stream, int count ) : void

Loads the buffer from a stream.

MakeReadOnly ( ) : void

Makes this buffer read only.

MultiChunkBuffer ( MongoDB.Bson.IO.BsonChunkPool chunkPool ) : System

Initializes a new instance of the MultiChunkBuffer class.

ReadBackingBytes ( int count ) : ArraySegment

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.

ReadByte ( ) : byte

Reads a byte.

ReadBytes ( int count ) : byte[]

Reads bytes.

ReadBytes ( byte destination, int destinationOffset, int count ) : void

Reads bytes.

WriteBackingBytes ( int count ) : ArraySegment

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.

WriteByte ( byte source ) : void

Writes a byte.

WriteBytes ( IByteBuffer source ) : void

Writes bytes.

WriteBytes ( byte source ) : void

Writes bytes.

WriteTo ( Stream stream ) : void

Writes Length bytes from this buffer starting at Position 0 to a stream.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ThrowIfDisposed ( ) : void

Throws if disposed.

Приватные методы

Метод Описание
EnsureDataAvailable ( int needed ) : void
EnsureIsReadOnly ( ) : void
EnsureIsWritable ( ) : void
EnsureSpaceAvailable ( int needed ) : void
ExpandCapacity ( int targetCapacity ) : void
MultiChunkBuffer ( IEnumerable chunks, int sliceOffset, int length, bool isReadOnly ) : System

Initializes a new instance of the MultiChunkBuffer class.

ShrinkCapacity ( int targetCapacity ) : void

Описание методов

Clear() публичный метод

Clears this instance.
MultiChunkBuffer The MultiChunkBuffer is read only.
public Clear ( ) : void
Результат void

Dispose() публичный метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

FindNullByte() публичный метод

Finds the next null byte.
MultiChunkBuffer
public FindNullByte ( ) : int
Результат int

GetSlice() публичный метод

Gets a slice of this buffer.
MultiChunkBuffer GetSlice can only be called for read only buffers. /// position /// or /// length ///
public GetSlice ( int position, int length ) : IByteBuffer
position int The position of the start of the slice.
length int The length of the slice.
Результат IByteBuffer

LoadFrom() публичный метод

Loads the buffer from a stream.
MultiChunkBuffer The MultiChunkBuffer is read only. stream count
public LoadFrom ( Stream stream, int count ) : void
stream Stream The stream.
count int The count.
Результат void

MakeReadOnly() публичный метод

Makes this buffer read only.
ByteArrayBuffer
public MakeReadOnly ( ) : void
Результат void

MultiChunkBuffer() публичный метод

Initializes a new instance of the MultiChunkBuffer class.
chunkPool
public MultiChunkBuffer ( MongoDB.Bson.IO.BsonChunkPool chunkPool ) : System
chunkPool MongoDB.Bson.IO.BsonChunkPool The chunk pool.
Результат System

ReadBackingBytes() публичный метод

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.
MultiChunkBuffer
public ReadBackingBytes ( int count ) : ArraySegment
count int The number of bytes you need to read.
Результат ArraySegment

ReadByte() публичный метод

Reads a byte.
MultiChunkBuffer
public ReadByte ( ) : byte
Результат byte

ReadBytes() публичный метод

Reads bytes.
MultiChunkBuffer
public ReadBytes ( int count ) : byte[]
count int The count.
Результат byte[]

ReadBytes() публичный метод

Reads bytes.
MultiChunkBuffer
public ReadBytes ( byte destination, int destinationOffset, int count ) : void
destination byte The destination.
destinationOffset int The destination offset.
count int The count.
Результат void

ThrowIfDisposed() защищенный метод

Throws if disposed.
protected ThrowIfDisposed ( ) : void
Результат void

WriteBackingBytes() публичный метод

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.
MultiChunkBuffer
public WriteBackingBytes ( int count ) : ArraySegment
count int The count.
Результат ArraySegment

WriteByte() публичный метод

Writes a byte.
MultiChunkBuffer The MultiChunkBuffer is read only.
public WriteByte ( byte source ) : void
source byte The byte.
Результат void

WriteBytes() публичный метод

Writes bytes.
MultiChunkBuffer The MultiChunkBuffer is read only.
public WriteBytes ( IByteBuffer source ) : void
source IByteBuffer The bytes (in the form of an IByteBuffer).
Результат void

WriteBytes() публичный метод

Writes bytes.
MultiChunkBuffer The MultiChunkBuffer is read only.
public WriteBytes ( byte source ) : void
source byte The bytes (in the form of a byte array).
Результат void

WriteTo() публичный метод

Writes Length bytes from this buffer starting at Position 0 to a stream.
MultiChunkBuffer
public WriteTo ( Stream stream ) : void
stream Stream The stream.
Результат void