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

MemoryStoreBuffer is a wrapper for a list that maintains position. In order to do this, MemoryStoreBuffer uses a ByteBuffer. More...

+ Inheritance diagram for AMPS.Client.MemoryStoreBuffer:

Public Member Functions

 MemoryStoreBuffer (int initialSize)
 Constructor for MemoryStoreBuffer. More...
 
long getSize ()
 Gets the size of the buffer. More...
 
void setSize (long newSize_)
 Sets the size of the buffer, growing if necessary. More...
 
long getPosition ()
 Gets the current position of the buffer. More...
 
void setPosition (long position_)
 Sets the new current position in the buffer. More...
 
void putByte (byte b)
 Writes the byte to the buffer and advances the position. More...
 
byte getByte ()
 Gets the next byte from the buffer and advances the position. More...
 
void putInt (int i)
 Writes the integer to the buffer. Advances current position. More...
 
void putInt (long position, int intValue)
 Writes the integer to the buffer at position, doesn't change current position. More...
 
int getInt ()
 Gets an integer from the buffer and advances the position. More...
 
int getInt (long position)
 Gets the integer from the buffer at position and doesn't change current position. More...
 
void putLong (long l)
 Writes thee long to the buffer and advances the position. More...
 
void putLong (long position, long longValue)
 Writes the long to the buffer at position and doesn't change current position. More...
 
long getLong ()
 Gets the long from the buffer and advances the position. More...
 
void putUlong (ulong l)
 Writes an unsigned long to the buffer and advances the position. More...
 
void putUlong (long position, ulong ulongValue)
 Writes an unsigned long to the buffer at position and doesn't change current position. More...
 
ulong getUlong ()
 Gets the unsigned long from the buffer and advances the position. More...
 
void putBytes (BlockPublishStore.ByteSequence bytes)
 Writes a series of bytes at the current position, taken from the specified BlockPublishStore.ByteSequence and advances the position. More...
 
void getBytes (BlockPublishStore.ByteSequence outBytes)
 Gets the series of bytes at the current position by placing them into the provided BlockPublishStore.ByteSequence object and advances the position. More...
 
void putBytes (byte[] buffer, int position, int length)
 Writes a series of bytes at the current position, taken from a byte array and advances the position. More...
 
void getBytes (Fields.Field outField, int length)
 Gets the series of bytes at the current position, this is done by copying them into a Field object and advances the position. More...
 
void zero (long offset, int length)
 Sets length bytes starting at offset to 0. More...
 
- Public Member Functions inherited from AMPS.Client.BlockPublishStore.Buffer
void getBytes (Field outBytes, int length)
 Reads data into a Field object from the buffer More...
 

Public Attributes

long _position = 0
 

Protected Attributes

byte[] _buffer = null
 
Store _store = null
 

Detailed Description

MemoryStoreBuffer is a wrapper for a list that maintains position. In order to do this, MemoryStoreBuffer uses a ByteBuffer.

Constructor & Destructor Documentation

◆ MemoryStoreBuffer()

AMPS.Client.MemoryStoreBuffer.MemoryStoreBuffer ( int  initialSize)
inline

Constructor for MemoryStoreBuffer.

Initializes a new instance of the MemoryStoreBuffer class with the specified initial size.

Parameters
initialSizeThe initial size of the buffer, specified in terms of the number of blocks.

Member Function Documentation

◆ getByte()

byte AMPS.Client.MemoryStoreBuffer.getByte ( )
inline

Gets the next byte from the buffer and advances the position.

Returns
The byte from the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getBytes() [1/2]

void AMPS.Client.MemoryStoreBuffer.getBytes ( BlockPublishStore.ByteSequence  outBytes)
inline

Gets the series of bytes at the current position by placing them into the provided BlockPublishStore.ByteSequence object and advances the position.

Parameters
outBytesThe ByteSequence object to be copied.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getBytes() [2/2]

void AMPS.Client.MemoryStoreBuffer.getBytes ( Fields.Field  outField,
int  length 
)
inline

Gets the series of bytes at the current position, this is done by copying them into a Field object and advances the position.

Parameters
outFieldThe Field object used to copy the byte sequence.
lengthThe length of the Field object.

◆ getInt() [1/2]

int AMPS.Client.MemoryStoreBuffer.getInt ( )
inline

Gets an integer from the buffer and advances the position.

Returns
The integer from the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getInt() [2/2]

int AMPS.Client.MemoryStoreBuffer.getInt ( long  position)
inline

Gets the integer from the buffer at position and doesn't change current position.

Parameters
positionThe position in the buffer where the integer begins.
Returns
The integer from the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getLong()

long AMPS.Client.MemoryStoreBuffer.getLong ( )
inline

Gets the long from the buffer and advances the position.

Returns
The long from the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getPosition()

long AMPS.Client.MemoryStoreBuffer.getPosition ( )
inline

Gets the current position of the buffer.

Returns
The current position of the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getSize()

long AMPS.Client.MemoryStoreBuffer.getSize ( )
inline

Gets the size of the buffer.

Returns
The size of the buffer

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ getUlong()

ulong AMPS.Client.MemoryStoreBuffer.getUlong ( )
inline

Gets the unsigned long from the buffer and advances the position.

Returns
The unsigned long from the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putByte()

void AMPS.Client.MemoryStoreBuffer.putByte ( byte  b)
inline

Writes the byte to the buffer and advances the position.

Parameters
bThe byte to be written in the buffer

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putBytes() [1/2]

void AMPS.Client.MemoryStoreBuffer.putBytes ( BlockPublishStore.ByteSequence  bytes)
inline

Writes a series of bytes at the current position, taken from the specified BlockPublishStore.ByteSequence and advances the position.

Parameters
bytesThe series of bytes to write at the current position.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putBytes() [2/2]

void AMPS.Client.MemoryStoreBuffer.putBytes ( byte[]  buffer,
int  position,
int  length 
)
inline

Writes a series of bytes at the current position, taken from a byte array and advances the position.

Parameters
bufferThe buffer containing a series of bytes.
positionThe position in the buffer where the series of bytes are located.
lengthThe length of the byte buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putInt() [1/2]

void AMPS.Client.MemoryStoreBuffer.putInt ( int  i)
inline

Writes the integer to the buffer. Advances current position.

Parameters
iThe integer to be placed in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putInt() [2/2]

void AMPS.Client.MemoryStoreBuffer.putInt ( long  position,
int  intValue 
)
inline

Writes the integer to the buffer at position, doesn't change current position.

Parameters
positionThe location where the integer is placed in the buffer.
intValueThe integer to bee placed in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putLong() [1/2]

void AMPS.Client.MemoryStoreBuffer.putLong ( long  l)
inline

Writes thee long to the buffer and advances the position.

Parameters
lThe long to write in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putLong() [2/2]

void AMPS.Client.MemoryStoreBuffer.putLong ( long  position,
long  longValue 
)
inline

Writes the long to the buffer at position and doesn't change current position.

Parameters
positionThe position in the buffer where the long should be placed.
longValueThe long to write in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putUlong() [1/2]

void AMPS.Client.MemoryStoreBuffer.putUlong ( long  position,
ulong  ulongValue 
)
inline

Writes an unsigned long to the buffer at position and doesn't change current position.

Parameters
positionThe position in the buffer where the unsigned long should be placed.
ulongValueThe unsigned long to write in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ putUlong() [2/2]

void AMPS.Client.MemoryStoreBuffer.putUlong ( ulong  l)
inline

Writes an unsigned long to the buffer and advances the position.

Parameters
lThe unsigned long to write in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ setPosition()

void AMPS.Client.MemoryStoreBuffer.setPosition ( long  position_)
inline

Sets the new current position in the buffer.

Parameters
position_The new current position to be set in the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ setSize()

void AMPS.Client.MemoryStoreBuffer.setSize ( long  newSize_)
inline

Sets the size of the buffer, growing if necessary.

Parameters
newSize_The new size to be assigned to the buffer.

Implements AMPS.Client.BlockPublishStore.Buffer.

◆ zero()

void AMPS.Client.MemoryStoreBuffer.zero ( long  offset,
int  length 
)
inline

Sets length bytes starting at offset to 0.

Parameters
offsetThe offset at which to start
lengthThe length of bytes to set to 0.

Implements AMPS.Client.BlockPublishStore.Buffer.


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