C# Класс Amqp.ByteBuffer

A byte array wrapper that has read and write cursors.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddReference void
ByteBuffer System
DuplicateBuffer void
ReleaseReference void
ToArraySegment ArraySegment

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

Метод Описание
AdjustPosition ( int offset, int length ) : void

Adjusts the read and write position.

Append ( int size ) : void

Advances the write position. As a result, length is increased by size.

ByteBuffer ( byte buffer, int offset, int count, int capacity ) : System

Initializes a new buffer from a byte array.

ByteBuffer ( int size, bool autoGrow ) : System

Initializes a new buffer of a specified size.

Complete ( int size ) : void

Advances the read position.

Reset ( ) : void

Resets read and write position to the initial state.

Seek ( int seekPosition ) : void

Sets the read position.

Shrink ( int size ) : void

Moves back the write position. As a result, length is decreased by size.

Validate ( bool write, int dataSize ) : void

Verifies that if the buffer has enough bytes for read or enough room for write and grow the buffer if needed.

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

Метод Описание
AddReference ( ) : void
ByteBuffer ( byte buffer, int offset, int count, int capacity, bool autoGrow ) : System
DuplicateBuffer ( int bufferSize, int dataSize, byte &buffer, int &offset, int &count ) : void
ReleaseReference ( ) : void
ToArraySegment ( ) : ArraySegment

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

AdjustPosition() публичный Метод

Adjusts the read and write position.
public AdjustPosition ( int offset, int length ) : void
offset int Read position to set.
length int Length from read position to set the write position.
Результат void

Append() публичный Метод

Advances the write position. As a result, length is increased by size.
public Append ( int size ) : void
size int Size to advance.
Результат void

ByteBuffer() публичный Метод

Initializes a new buffer from a byte array.
public ByteBuffer ( byte buffer, int offset, int count, int capacity ) : System
buffer byte The byte array.
offset int The start position.
count int The number of bytes.
capacity int The total size of the byte array from offset.
Результат System

ByteBuffer() публичный Метод

Initializes a new buffer of a specified size.
public ByteBuffer ( int size, bool autoGrow ) : System
size int The size in bytes.
autoGrow bool If the buffer should auto-grow when a write size is larger than the buffer size.
Результат System

Complete() публичный Метод

Advances the read position.
public Complete ( int size ) : void
size int Size to advance.
Результат void

Reset() публичный Метод

Resets read and write position to the initial state.
public Reset ( ) : void
Результат void

Seek() публичный Метод

Sets the read position.
public Seek ( int seekPosition ) : void
seekPosition int Position to set.
Результат void

Shrink() публичный Метод

Moves back the write position. As a result, length is decreased by size.
public Shrink ( int size ) : void
size int
Результат void

Validate() публичный Метод

Verifies that if the buffer has enough bytes for read or enough room for write and grow the buffer if needed.
public Validate ( bool write, int dataSize ) : void
write bool Operation to verify. True for write and false for read.
dataSize int The size to read or write.
Результат void