C# 클래스 OpenStory.Common.IO.BoundedBuffer

Represents a moderate-performance byte buffer with a maximum capacity.
상속: IDisposable
파일 보기 프로젝트 열기: shoftee/OpenStory 1 사용 예제들

공개 메소드들

메소드 설명
AppendFill ( byte buffer, int offset, int count ) : int

Takes bytes starting from an offset in an array segment and appends as many as possible to the buffer.

This method will append a maximum of count elements to the end of the buffer, starting at offset in buffer.

If there is not enough space for count elements, it will fill the remaining space with bytes from the start of buffer.

BoundedBuffer ( ) : System

Initializes a new instance of the class with no capacity.

A BoundedBuffer with no capacity is unusable. Any consumer of this class must call Reset(int) to assign a capacity before they can use it.

BoundedBuffer ( int capacity ) : System

Initializes a new instance of the BoundedBuffer class with a maximum capacity.

Dispose ( ) : void
ExtractAndReset ( int newCapacity ) : byte[]

Extracts the data from the BoundedBuffer and prepares it for the new data.

Reset ( int newCapacity ) : void

Prepares the buffer for new data.

비공개 메소드들

메소드 설명
AppendInternal ( byte buffer, int offset, int requested ) : int
Dispose ( bool disposing ) : void

Virtual dispose method. When overriding, call the base implementation before your logic.

GetCapacityIsNonPositiveException ( int capacity ) : ArgumentOutOfRangeException
GetCountIsNonPositiveException ( int count ) : ArgumentOutOfRangeException
GetNewCapacityIsNegativeException ( int newCapacity ) : ArgumentOutOfRangeException
GetOffsetIsNegativeException ( int offset ) : ArgumentOutOfRangeException
ResetInternal ( int newCapacity ) : void
ThrowIfDisposed ( ) : void

Throws a new ObjectDisposedException if the current object is disposed.

메소드 상세

AppendFill() 공개 메소드

Takes bytes starting from an offset in an array segment and appends as many as possible to the buffer.
This method will append a maximum of count elements to the end of the buffer, starting at offset in buffer.

If there is not enough space for count elements, it will fill the remaining space with bytes from the start of buffer.

Thrown if is . Thrown if is negative or is non-positive. Thrown if the array segment given by the and parameters falls outside of the given array's bounds.
public AppendFill ( byte buffer, int offset, int count ) : int
buffer byte The array to read from.
offset int The start of the segment.
count int The number of bytes to append.
리턴 int

BoundedBuffer() 공개 메소드

Initializes a new instance of the class with no capacity.
A BoundedBuffer with no capacity is unusable. Any consumer of this class must call Reset(int) to assign a capacity before they can use it.
public BoundedBuffer ( ) : System
리턴 System

BoundedBuffer() 공개 메소드

Initializes a new instance of the BoundedBuffer class with a maximum capacity.
The exception is thrown if is non-positive.
public BoundedBuffer ( int capacity ) : System
capacity int The maximum capacity to assign.
리턴 System

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

ExtractAndReset() 공개 메소드

Extracts the data from the BoundedBuffer and prepares it for the new data.
Thrown if is negative.
public ExtractAndReset ( int newCapacity ) : byte[]
newCapacity int The new capacity for the .
리턴 byte[]

Reset() 공개 메소드

Prepares the buffer for new data.
Thrown if is negative.
public Reset ( int newCapacity ) : void
newCapacity int The new capacity for the buffer.
리턴 void