C# 클래스 MongoDB.Bson.IO.ByteArrayBuffer

A BSON buffer that is backed by a byte array.
상속: IByteBuffer
파일 보기 프로젝트 열기: egametang/Egametang 1 사용 예제들

공개 메소드들

메소드 설명
ByteArrayBuffer ( byte bytes, int sliceOffset, int length, bool isReadOnly ) : System

Initializes a new instance of the ByteArrayBuffer class.

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.

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 bytes ) : void

Writes bytes.

WriteTo ( Stream stream ) : void

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

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

EnsureIsReadOnly ( ) : void

Ensures the buffer is read only.

EnsureIsWritable ( ) : void

Ensures the buffer is writable.

ThrowIfDisposed ( ) : void

Throws if disposed.

비공개 메소드들

메소드 설명
EnsureDataAvailable ( int needed ) : void
EnsureSpaceAvailable ( int needed ) : void

메소드 상세

ByteArrayBuffer() 공개 메소드

Initializes a new instance of the ByteArrayBuffer class.
bytes
public ByteArrayBuffer ( byte bytes, int sliceOffset, int length, bool isReadOnly ) : System
bytes byte The backing bytes.
sliceOffset int The offset where the slice begins.
length int The length of the slice.
isReadOnly bool Whether the buffer is read only.
리턴 System

Clear() 공개 메소드

Clears this instance.
ByteArrayBuffer Write operations are not allowed for read only buffers.
public Clear ( ) : void
리턴 void

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
리턴 void

EnsureIsReadOnly() 보호된 메소드

Ensures the buffer is read only.
ByteArrayBuffer is not read only.
protected EnsureIsReadOnly ( ) : void
리턴 void

EnsureIsWritable() 보호된 메소드

Ensures the buffer is writable.
ByteArrayBuffer is not writable.
protected EnsureIsWritable ( ) : void
리턴 void

FindNullByte() 공개 메소드

Finds the next null byte.
ByteArrayBuffer
public FindNullByte ( ) : int
리턴 int

GetSlice() 공개 메소드

Gets a slice of this buffer.
ByteArrayBuffer 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.
ByteArrayBuffer Write operations are not allowed for read only buffers. 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

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.
ByteArrayBuffer
public ReadBackingBytes ( int count ) : ArraySegment
count int The number of bytes you need to read.
리턴 ArraySegment

ReadByte() 공개 메소드

Reads a byte.
ByteArrayBuffer
public ReadByte ( ) : byte
리턴 byte

ReadBytes() 공개 메소드

Reads bytes.
ByteArrayBuffer
public ReadBytes ( int count ) : byte[]
count int The count.
리턴 byte[]

ReadBytes() 공개 메소드

Reads bytes.
ByteArrayBuffer
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.
public WriteBackingBytes ( int count ) : ArraySegment
count int The count.
리턴 ArraySegment

WriteByte() 공개 메소드

Writes a byte.
ByteArrayBuffer Write operations are not allowed for read only buffers.
public WriteByte ( byte source ) : void
source byte The byte.
리턴 void

WriteBytes() 공개 메소드

Writes bytes.
ByteArrayBuffer Write operations are not allowed for read only buffers.
public WriteBytes ( IByteBuffer source ) : void
source IByteBuffer The bytes (in the form of an IByteBuffer).
리턴 void

WriteBytes() 공개 메소드

Writes bytes.
ByteArrayBuffer Write operations are not allowed for read only buffers.
public WriteBytes ( byte bytes ) : void
bytes byte The bytes.
리턴 void

WriteTo() 공개 메소드

Writes Length bytes from this buffer starting at Position 0 to a stream.
ByteArrayBuffer
public WriteTo ( Stream stream ) : void
stream Stream The stream.
리턴 void