KS.Reactor.ksInputBuffer Class Reference

This input buffer reads data written to a byte array by a ksOutputBuffer. More...

Public Member Functions

 ksInputBuffer (byte[] data)
 Construct an input buffer from a byte array. More...
 
void Reset ()
 Reset the internal position to the beginning of the array. More...
 
byte[] GetBytes (int length)
 Gets bytes from the buffer. More...
 
Get< T > ()
 Gets a struct of type T from the buffer. More...
 
bool GetBool ()
 Gets a bool from the buffer. More...
 
byte GetByte ()
 Gets a byte from the buffer. More...
 
char GetChar ()
 Gets a char from the buffer. More...
 
short GetShort ()
 Gets a short from the buffer. More...
 
ushort GetUShort ()
 Gets a ushort from the buffer. More...
 
int GetInt ()
 Gets an int from the buffer. More...
 
uint GetUInt ()
 Gets a uint from the buffer. More...
 
long GetLong ()
 Gets a long from the buffer. More...
 
ulong GetULong ()
 Gets a ulong from the buffer. More...
 
float GetFloat ()
 Gets a float from the buffer. More...
 
double GetDouble ()
 Gets a double from the buffer. More...
 
string GetString ()
 Gets a string from the buffer. More...
 
bool[] GetBoolArray ()
 Get an array of bools from the buffer. More...
 
byte[] GetByteArray ()
 Get an array of bytes from the buffer. More...
 
char[] GetCharArray ()
 Get an array of chars from the buffer. More...
 
short[] GetShortArray ()
 Get an array of shorts from the buffer. More...
 
ushort[] GetUShortArray ()
 Get an array of ushorts from the buffer. More...
 
int[] GetIntArray ()
 Get an array of ints from the buffer. More...
 
uint[] GetUIntArray ()
 Get an array of uints from the buffer. More...
 
long[] GetLongArray ()
 Get an array of longs from the buffer. More...
 
ulong[] GetULongArray ()
 Get an array of ulongs from the buffer. More...
 
float[] GetFloatArray ()
 Get an array of floats from the buffer. More...
 
double[] GetDoubleArray ()
 Get an array of doubles from the buffer. More...
 
string[] GetStringArray ()
 Get an array of strings from the buffer. More...
 
GetBufferable< T > ()
 Get a ksIBufferable object from the buffer. More...
 
ksMultiType GetMultiType ()
 Get a ksMultitype from the buffer. More...
 

Properties

bool EndOfData [get]
 Check if the internal position has reached the end of the buffer. More...
 

Detailed Description

This input buffer reads data written to a byte array by a ksOutputBuffer.

Constructor & Destructor Documentation

◆ ksInputBuffer()

KS.Reactor.ksInputBuffer.ksInputBuffer ( byte[]  data)

Construct an input buffer from a byte array.

Parameters
dataData source.

Member Function Documentation

◆ Get< T >()

T KS.Reactor.ksInputBuffer.Get< T > ( )

Gets a struct of type T from the buffer.

Template Parameters
T
Returns
Struct value.
Type Constraints
T :struct 

◆ GetBool()

bool KS.Reactor.ksInputBuffer.GetBool ( )

Gets a bool from the buffer.

Returns
Bool value.

◆ GetBoolArray()

bool [] KS.Reactor.ksInputBuffer.GetBoolArray ( )

Get an array of bools from the buffer.

Returns
Bool array.

◆ GetBufferable< T >()

T KS.Reactor.ksInputBuffer.GetBufferable< T > ( )

Get a ksIBufferable object from the buffer.

Returns
ksIBufferable object.
Type Constraints
T :ksIBufferable 
T :new() 

◆ GetByte()

byte KS.Reactor.ksInputBuffer.GetByte ( )

Gets a byte from the buffer.

Returns
Byte value.

◆ GetByteArray()

byte [] KS.Reactor.ksInputBuffer.GetByteArray ( )

Get an array of bytes from the buffer.

Returns
Byte array.

◆ GetBytes()

byte [] KS.Reactor.ksInputBuffer.GetBytes ( int  length)

Gets bytes from the buffer.

Parameters
lengthLength of byte array to get.
Returns
Byte array.

◆ GetChar()

char KS.Reactor.ksInputBuffer.GetChar ( )

Gets a char from the buffer.

Returns
Char value.

◆ GetCharArray()

char [] KS.Reactor.ksInputBuffer.GetCharArray ( )

Get an array of chars from the buffer.

Returns
Char array.

◆ GetDouble()

double KS.Reactor.ksInputBuffer.GetDouble ( )

Gets a double from the buffer.

Returns
Double value.

◆ GetDoubleArray()

double [] KS.Reactor.ksInputBuffer.GetDoubleArray ( )

Get an array of doubles from the buffer.

Returns
Double array.

◆ GetFloat()

float KS.Reactor.ksInputBuffer.GetFloat ( )

Gets a float from the buffer.

Returns
Float value.

◆ GetFloatArray()

float [] KS.Reactor.ksInputBuffer.GetFloatArray ( )

Get an array of floats from the buffer.

Returns
Float array.

◆ GetInt()

int KS.Reactor.ksInputBuffer.GetInt ( )

Gets an int from the buffer.

Returns
Int value.

◆ GetIntArray()

int [] KS.Reactor.ksInputBuffer.GetIntArray ( )

Get an array of ints from the buffer.

Returns
Int array.

◆ GetLong()

long KS.Reactor.ksInputBuffer.GetLong ( )

Gets a long from the buffer.

Returns
Long value.

◆ GetLongArray()

long [] KS.Reactor.ksInputBuffer.GetLongArray ( )

Get an array of longs from the buffer.

Returns
Long array.

◆ GetMultiType()

ksMultiType KS.Reactor.ksInputBuffer.GetMultiType ( )

Get a ksMultitype from the buffer.

Returns
ksMultitype value.

◆ GetShort()

short KS.Reactor.ksInputBuffer.GetShort ( )

Gets a short from the buffer.

Returns
Short value.

◆ GetShortArray()

short [] KS.Reactor.ksInputBuffer.GetShortArray ( )

Get an array of shorts from the buffer.

Returns
Short array.

◆ GetString()

string KS.Reactor.ksInputBuffer.GetString ( )

Gets a string from the buffer.

Returns
String value.

◆ GetStringArray()

string [] KS.Reactor.ksInputBuffer.GetStringArray ( )

Get an array of strings from the buffer.

Returns
String array.

◆ GetUInt()

uint KS.Reactor.ksInputBuffer.GetUInt ( )

Gets a uint from the buffer.

Returns
Uint value.

◆ GetUIntArray()

uint [] KS.Reactor.ksInputBuffer.GetUIntArray ( )

Get an array of uints from the buffer.

Returns
Uint array.

◆ GetULong()

ulong KS.Reactor.ksInputBuffer.GetULong ( )

Gets a ulong from the buffer.

Returns
Ulong value.

◆ GetULongArray()

ulong [] KS.Reactor.ksInputBuffer.GetULongArray ( )

Get an array of ulongs from the buffer.

Returns
Ulong array.

◆ GetUShort()

ushort KS.Reactor.ksInputBuffer.GetUShort ( )

Gets a ushort from the buffer.

Returns
Ushort value.

◆ GetUShortArray()

ushort [] KS.Reactor.ksInputBuffer.GetUShortArray ( )

Get an array of ushorts from the buffer.

Returns
Ushort array.

◆ Reset()

void KS.Reactor.ksInputBuffer.Reset ( )

Reset the internal position to the beginning of the array.

Property Documentation

◆ EndOfData

bool KS.Reactor.ksInputBuffer.EndOfData
get

Check if the internal position has reached the end of the buffer.