C# Class Amqp.ByteBuffer

A byte array wrapper that has read and write cursors.
Afficher le fichier Open project: xamarin/mini-hacks Class Usage Examples

Private Properties

Свойство Type Description
AddReference void
ByteBuffer System
DuplicateBuffer void
ReleaseReference void
ToArraySegment ArraySegment

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

AdjustPosition() public méthode

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.
Résultat void

Append() public méthode

Advances the write position. As a result, length is increased by size.
public Append ( int size ) : void
size int Size to advance.
Résultat void

ByteBuffer() public méthode

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.
Résultat System

ByteBuffer() public méthode

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.
Résultat System

Complete() public méthode

Advances the read position.
public Complete ( int size ) : void
size int Size to advance.
Résultat void

Reset() public méthode

Resets read and write position to the initial state.
public Reset ( ) : void
Résultat void

Seek() public méthode

Sets the read position.
public Seek ( int seekPosition ) : void
seekPosition int Position to set.
Résultat void

Shrink() public méthode

Moves back the write position. As a result, length is decreased by size.
public Shrink ( int size ) : void
size int
Résultat void

Validate() public méthode

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.
Résultat void