AMPS C# Client  5.3.5.0
AMPS C# Client for .NET
AMPS.Client.SimpleReadBuffer Class Reference

Represents a simple read buffer used for reading byte data. More...

Public Member Functions

 SimpleReadBuffer ()
 Initializes a new instance of the SimpleReadBuffer class. More...
 
 SimpleReadBuffer (byte[] buf, int length)
 Initializes a new instance of the SimpleReadBuffer class with the specified buffer and length. More...
 
void Reset (byte[] buf, int pos, int length)
 Resets the SimpleReadBuffer with the specified buffer, position, and length. More...
 
byte ReadByte ()
 Reads a byte from the buffer and advances the position. More...
 
byte PeekByte ()
 Peeks at the next byte in the buffer without advancing the position. More...
 
byte PeekByte (int position)
 Peeks at the byte at the specified position in the buffer. More...
 
void put (int index, byte b)
 Puts a byte at the specified index in the buffer. More...
 

Public Attributes

int Position
 Gets or sets the position within the buffer. More...
 
int Length
 Gets or sets the length of the buffer. More...
 
byte[] Buffer
 Gets or sets the buffer. More...
 

Detailed Description

Represents a simple read buffer used for reading byte data.

Constructor & Destructor Documentation

◆ SimpleReadBuffer() [1/2]

AMPS.Client.SimpleReadBuffer.SimpleReadBuffer ( )
inline

Initializes a new instance of the SimpleReadBuffer class.

◆ SimpleReadBuffer() [2/2]

AMPS.Client.SimpleReadBuffer.SimpleReadBuffer ( byte[]  buf,
int  length 
)
inline

Initializes a new instance of the SimpleReadBuffer class with the specified buffer and length.

Parameters
bufThe buffer.
lengthThe length of the buffer.

Member Function Documentation

◆ PeekByte() [1/2]

byte AMPS.Client.SimpleReadBuffer.PeekByte ( )
inline

Peeks at the next byte in the buffer without advancing the position.

Returns
The next byte in the buffer.

◆ PeekByte() [2/2]

byte AMPS.Client.SimpleReadBuffer.PeekByte ( int  position)
inline

Peeks at the byte at the specified position in the buffer.

Parameters
positionThe position to peek at.
Returns
The byte at the specified position.

◆ put()

void AMPS.Client.SimpleReadBuffer.put ( int  index,
byte  b 
)
inline

Puts a byte at the specified index in the buffer.

Parameters
indexThe index at which to put the byte.
bThe byte to put.

◆ ReadByte()

byte AMPS.Client.SimpleReadBuffer.ReadByte ( )
inline

Reads a byte from the buffer and advances the position.

Returns
The byte read from the buffer.

◆ Reset()

void AMPS.Client.SimpleReadBuffer.Reset ( byte[]  buf,
int  pos,
int  length 
)
inline

Resets the SimpleReadBuffer with the specified buffer, position, and length.

Parameters
bufThe buffer.
posThe position within the buffer.
lengthThe length of the buffer.

Member Data Documentation

◆ Buffer

byte [] AMPS.Client.SimpleReadBuffer.Buffer

Gets or sets the buffer.

◆ Length

int AMPS.Client.SimpleReadBuffer.Length

Gets or sets the length of the buffer.

◆ Position

int AMPS.Client.SimpleReadBuffer.Position

Gets or sets the position within the buffer.


The documentation for this class was generated from the following file: