C# 클래스 ServerToolkit.BufferManagement.ManagedBuffer

Represents an efficiently allocated buffer for asynchronous read/write operations.
상속: IBuffer
파일 보기 프로젝트 열기: tenor/ServerToolkit 1 사용 예제들

Private Properties

프로퍼티 타입 설명
CopyFrom void
CopyFrom void
Dispose void
FindBlockWithOffset void
ManagedBuffer System
ManagedBuffer System

공개 메소드들

메소드 설명
CopyTo ( byte destinationArray ) : void

Copies data from the buffer to a byte array.

The size of the buffer must be less than or equal to the destinationArray length.

CopyTo ( byte destinationArray, long destinationIndex, long length ) : void

Copies data from the buffer to a byte array

Dispose ( ) : void

Releases resources used by the buffer.

This method frees the memory blocks used by the buffer.

FillWith ( byte sourceArray ) : void

Copies data from a byte array into the buffer.

The length of the sourceArray must be less than or equal to the buffer size.

FillWith ( byte sourceArray, long sourceIndex, long length ) : void

Copies data from a byte array into the buffer.

GetSegments ( ) : IList>

Gets buffer segments that can be passed on to an asynchronous socket operation.

GetSegments ( long length ) : IList>

Gets buffer segments that can be passed on to an asynchronous socket operation.

GetSegments ( long offset, long length ) : IList>

Gets buffer segments that can be passed on to an asynchronous socket operation.

비공개 메소드들

메소드 설명
CopyFrom ( byte sourceArray ) : void
CopyFrom ( byte sourceArray, long sourceIndex, long length ) : void
Dispose ( bool disposing ) : void

Releases resources used by the buffer.

FindBlockWithOffset ( long offset, int &blockIndex, long &blockOffSet ) : void
ManagedBuffer ( IList allocatedMemoryBlocks ) : System

Initializes a new instance of the ManagedBuffer class, specifying the memory block that the ManagedBuffer reads and writes to.

ManagedBuffer ( IMemorySlab slab ) : System

Initializes a new instance of the ManagedBuffer class, specifying the slab to be associated with the ManagedBuffer. This constructor creates an empty (zero-length) buffer.

메소드 상세

CopyTo() 공개 메소드

Copies data from the buffer to a byte array.
The size of the buffer must be less than or equal to the destinationArray length.
public CopyTo ( byte destinationArray ) : void
destinationArray byte The one-dimensional byte array which receives the data.
리턴 void

CopyTo() 공개 메소드

Copies data from the buffer to a byte array
public CopyTo ( byte destinationArray, long destinationIndex, long length ) : void
destinationArray byte The one-dimensional byte array which receives the data.
destinationIndex long The index in the destinationArray at which storing begins.
length long The number of bytes to copy.
리턴 void

Dispose() 공개 메소드

Releases resources used by the buffer.
This method frees the memory blocks used by the buffer.
public Dispose ( ) : void
리턴 void

FillWith() 공개 메소드

Copies data from a byte array into the buffer.
The length of the sourceArray must be less than or equal to the buffer size.
public FillWith ( byte sourceArray ) : void
sourceArray byte The one-dimensional byte array that contains the data.
리턴 void

FillWith() 공개 메소드

Copies data from a byte array into the buffer.
public FillWith ( byte sourceArray, long sourceIndex, long length ) : void
sourceArray byte The one-dimensional byte array that contains the data.
sourceIndex long The index in the sourceArray at which copying begins.
length long The number of bytes to copy.
리턴 void

GetSegments() 공개 메소드

Gets buffer segments that can be passed on to an asynchronous socket operation.
public GetSegments ( ) : IList>
리턴 IList>

GetSegments() 공개 메소드

Gets buffer segments that can be passed on to an asynchronous socket operation.
public GetSegments ( long length ) : IList>
length long Total length of segments.
리턴 IList>

GetSegments() 공개 메소드

Gets buffer segments that can be passed on to an asynchronous socket operation.
public GetSegments ( long offset, long length ) : IList>
offset long Offset in the buffer where segments start.
length long Total length of segments.
리턴 IList>