C# Class Gurux.DLMS.GXByteBuffer

Byte array class is used to save received bytes.
Mostra file Open project: Gurux/Gurux.DLMS.Net Class Usage Examples

Public Methods

Method Description
Add ( object value ) : void

Add new object to the byte buffer.

Array ( ) : byte[]

Returs data as byte array.

Clear ( ) : void

Clear buffer but do not release memory.

Compare ( byte arr ) : bool

Compares, whether two given arrays are similar starting from current position.

Get ( byte target ) : void

Get value from the byte array.

GetDouble ( ) : double

Get double value from byte array from the current position and then increments the position.

GetFloat ( ) : float

Get float value from byte array from the current position and then increments the position.

GetInt16 ( ) : Int16

Get Int16 value from byte array from the current position and then increments the position.

GetInt16 ( int index ) : Int16

Get Int16 value from byte array.

GetInt32 ( ) : Int32

Get UInt32 value from byte array from the current position and then increments the position.

GetInt64 ( ) : System.Int64

Get Int64 value from byte array from the current position and then increments the position.

GetInt8 ( ) : sbyte

Get Int8 value from byte array from the current position and then increments the position.

GetString ( int count ) : string

Get String value from byte array.

GetString ( int index, int count ) : string

Get String value from byte array.

GetStringUtf8 ( int index, int count ) : string

Get String value from byte array.

GetUInt16 ( ) : UInt16

Get UInt16 value from byte array from the current position and then increments the position.

GetUInt16 ( int index ) : UInt16

Get UInt16 value from byte array.

GetUInt32 ( ) : UInt32

Get UInt32 value from byte array from the current position and then increments the position.

GetUInt32 ( int index ) : UInt32

Get Int32 value from byte array.

GetUInt64 ( ) : System.UInt64

Get UInt64 value from byte array from the current position and then increments the position.

GetUInt8 ( ) : byte

Get UInt8 value from byte array from the current position and then increments the position.

GetUInt8 ( int index ) : byte

Get UInt8 value from byte array.

Move ( int srcPos, int destPos, int count ) : void

Move content from source to destination.

Set ( GXByteBuffer value ) : void
Set ( GXByteBuffer value, int count ) : void

Set new value to byte array.

Set ( byte value ) : void

Push the given byte array into this buffer at the current position, and then increments the position.

Set ( byte value, int index, int count ) : void

Set new value to byte array.

Set ( int index, byte value ) : void

Push the given byte array into this buffer at the current position, and then increments the position.

SetDouble ( double value ) : void

Set float value to byte array.

SetFloat ( float value ) : void

Set float value to byte array.

SetHexString ( int index, string value ) : void

Push the given hex string as byte array into this buffer at the current position, and then increments the position.

SetHexString ( string value ) : void

Push the given hex string as byte array into this buffer at the current position, and then increments the position.

SetHexString ( string value, int index, int count ) : void

Push the given hex string as byte array into this buffer at the current position, and then increments the position.

SetInt16 ( Int16 value ) : void

Push the given Int16 into this buffer at the current position, and then increments the position.

SetInt16 ( int index, Int16 value ) : void

Push the given Int16 into this buffer at the given position.

SetInt32 ( Int32 value ) : void

Push the given UInt32 into this buffer at the current position, and then increments the position.

SetInt32 ( int index, Int32 item ) : void

Push the given UInt32 into this buffer at the given position.

SetInt64 ( System.Int64 value ) : void

Push the given UInt64 into this buffer at the current position, and then increments the position.

SetInt64 ( int index, System.Int64 item ) : void

Push the given UInt64 into this buffer at the given position.

SetUInt16 ( UInt16 value ) : void

Push the given UInt16 into this buffer at the current position, and then increments the position.

SetUInt16 ( int index, UInt16 value ) : void

Push the given UInt16 into this buffer at the given position.

SetUInt32 ( UInt32 value ) : void

Push the given UInt32 into this buffer at the current position, and then increments the position.

SetUInt32 ( int index, UInt32 item ) : void

Push the given UInt32 into this buffer at the given position.

SetUInt64 ( System.UInt64 value ) : void

Push the given UInt64 into this buffer at the current position, and then increments the position.

SetUInt64 ( int index, System.UInt64 item ) : void

Push the given UInt64 into this buffer at the given position.

SetUInt8 ( byte value ) : void

Push the given byte into this buffer at the current position, and then increments the position.

SetUInt8 ( int index, byte value ) : void

Push the given UInt8 into this buffer at the given position.

SubArray ( int index, int count ) : byte[]

Returns data as byte array.

ToString ( ) : string
Trim ( ) : void

Remove handled bytes.

This can be used in debugging to remove handled bytes.

Private Methods

Method Description
GXByteBuffer ( ) : System
GXByteBuffer ( GXByteBuffer value ) : System
GXByteBuffer ( UInt16 capacity ) : System
GXByteBuffer ( byte value ) : System
SetUInt8 ( Enum value ) : void

Push the given enumeration value as byte into this buffer at the current position, and then increments the position.

Method Details

Add() public method

Add new object to the byte buffer.
public Add ( object value ) : void
value object Value to add.
return void

Array() public method

Returs data as byte array.
public Array ( ) : byte[]
return byte[]

Clear() public method

Clear buffer but do not release memory.
public Clear ( ) : void
return void

Compare() public method

Compares, whether two given arrays are similar starting from current position.
public Compare ( byte arr ) : bool
arr byte Array to compare.
return bool

Get() public method

Get value from the byte array.
public Get ( byte target ) : void
target byte Target array.
return void

GetDouble() public method

Get double value from byte array from the current position and then increments the position.
public GetDouble ( ) : double
return double

GetFloat() public method

Get float value from byte array from the current position and then increments the position.
public GetFloat ( ) : float
return float

GetInt16() public method

Get Int16 value from byte array from the current position and then increments the position.
public GetInt16 ( ) : Int16
return System.Int16

GetInt16() public method

Get Int16 value from byte array.
public GetInt16 ( int index ) : Int16
index int Byte index.
return System.Int16

GetInt32() public method

Get UInt32 value from byte array from the current position and then increments the position.
public GetInt32 ( ) : Int32
return System.Int32

GetInt64() public method

Get Int64 value from byte array from the current position and then increments the position.
public GetInt64 ( ) : System.Int64
return System.Int64

GetInt8() public method

Get Int8 value from byte array from the current position and then increments the position.
public GetInt8 ( ) : sbyte
return sbyte

GetString() public method

Get String value from byte array.
public GetString ( int count ) : string
count int Byte count.
return string

GetString() public method

Get String value from byte array.
public GetString ( int index, int count ) : string
index int Byte index.
count int Byte count.
return string

GetStringUtf8() public method

Get String value from byte array.
public GetStringUtf8 ( int index, int count ) : string
index int Byte index.
count int Byte count.
return string

GetUInt16() public method

Get UInt16 value from byte array from the current position and then increments the position.
public GetUInt16 ( ) : UInt16
return System.UInt16

GetUInt16() public method

Get UInt16 value from byte array.
public GetUInt16 ( int index ) : UInt16
index int Byte index.
return System.UInt16

GetUInt32() public method

Get UInt32 value from byte array from the current position and then increments the position.
public GetUInt32 ( ) : UInt32
return System.UInt32

GetUInt32() public method

Get Int32 value from byte array.
public GetUInt32 ( int index ) : UInt32
index int Byte index.
return System.UInt32

GetUInt64() public method

Get UInt64 value from byte array from the current position and then increments the position.
public GetUInt64 ( ) : System.UInt64
return System.UInt64

GetUInt8() public method

Get UInt8 value from byte array from the current position and then increments the position.
public GetUInt8 ( ) : byte
return byte

GetUInt8() public method

Get UInt8 value from byte array.
public GetUInt8 ( int index ) : byte
index int Byte index.
return byte

Move() public method

Move content from source to destination.
public Move ( int srcPos, int destPos, int count ) : void
srcPos int Source position.
destPos int Destination position.
count int Item count.
return void

Set() public method

public Set ( GXByteBuffer value ) : void
value GXByteBuffer
return void

Set() public method

Set new value to byte array.
public Set ( GXByteBuffer value, int count ) : void
value GXByteBuffer Byte array to add.
count int Byte count.
return void

Set() public method

Push the given byte array into this buffer at the current position, and then increments the position.
public Set ( byte value ) : void
value byte The value to be added.
return void

Set() public method

Set new value to byte array.
public Set ( byte value, int index, int count ) : void
value byte Byte array to add.
index int Byte index.
count int Byte count.
return void

Set() public method

Push the given byte array into this buffer at the current position, and then increments the position.
public Set ( int index, byte value ) : void
index int Byte index.
value byte The value to be added.
return void

SetDouble() public method

Set float value to byte array.
public SetDouble ( double value ) : void
value double
return void

SetFloat() public method

Set float value to byte array.
public SetFloat ( float value ) : void
value float
return void

SetHexString() public method

Push the given hex string as byte array into this buffer at the current position, and then increments the position.
public SetHexString ( int index, string value ) : void
index int Byte index.
value string The hex string to be added.
return void

SetHexString() public method

Push the given hex string as byte array into this buffer at the current position, and then increments the position.
public SetHexString ( string value ) : void
value string The hex string to be added.
return void

SetHexString() public method

Push the given hex string as byte array into this buffer at the current position, and then increments the position.
public SetHexString ( string value, int index, int count ) : void
value string Byte array to add.
index int Byte index.
count int Byte count.
return void

SetInt16() public method

Push the given Int16 into this buffer at the current position, and then increments the position.
public SetInt16 ( Int16 value ) : void
value System.Int16 The value to be added.
return void

SetInt16() public method

Push the given Int16 into this buffer at the given position.
public SetInt16 ( int index, Int16 value ) : void
index int Zero based byte index where value is set.
value System.Int16 The value to be added.
return void

SetInt32() public method

Push the given UInt32 into this buffer at the current position, and then increments the position.
public SetInt32 ( Int32 value ) : void
value System.Int32 The value to be added.
return void

SetInt32() public method

Push the given UInt32 into this buffer at the given position.
public SetInt32 ( int index, Int32 item ) : void
index int Zero based byte index where value is set.
item System.Int32
return void

SetInt64() public method

Push the given UInt64 into this buffer at the current position, and then increments the position.
public SetInt64 ( System.Int64 value ) : void
value System.Int64 The value to be added.
return void

SetInt64() public method

Push the given UInt64 into this buffer at the given position.
public SetInt64 ( int index, System.Int64 item ) : void
index int Zero based byte index where value is set.
item System.Int64
return void

SetUInt16() public method

Push the given UInt16 into this buffer at the current position, and then increments the position.
public SetUInt16 ( UInt16 value ) : void
value System.UInt16 The value to be added.
return void

SetUInt16() public method

Push the given UInt16 into this buffer at the given position.
public SetUInt16 ( int index, UInt16 value ) : void
index int Zero based byte index where value is set.
value System.UInt16 The value to be added.
return void

SetUInt32() public method

Push the given UInt32 into this buffer at the current position, and then increments the position.
public SetUInt32 ( UInt32 value ) : void
value System.UInt32 The value to be added.
return void

SetUInt32() public method

Push the given UInt32 into this buffer at the given position.
public SetUInt32 ( int index, UInt32 item ) : void
index int Zero based byte index where value is set.
item System.UInt32
return void

SetUInt64() public method

Push the given UInt64 into this buffer at the current position, and then increments the position.
public SetUInt64 ( System.UInt64 value ) : void
value System.UInt64 The value to be added.
return void

SetUInt64() public method

Push the given UInt64 into this buffer at the given position.
public SetUInt64 ( int index, System.UInt64 item ) : void
index int Zero based byte index where value is set.
item System.UInt64
return void

SetUInt8() public method

Push the given byte into this buffer at the current position, and then increments the position.
public SetUInt8 ( byte value ) : void
value byte The value to be added.
return void

SetUInt8() public method

Push the given UInt8 into this buffer at the given position.
public SetUInt8 ( int index, byte value ) : void
index int Zero based byte index where value is set.
value byte The byte to be added.
return void

SubArray() public method

Returns data as byte array.
public SubArray ( int index, int count ) : byte[]
index int
count int
return byte[]

ToString() public method

public ToString ( ) : string
return string

Trim() public method

Remove handled bytes.
This can be used in debugging to remove handled bytes.
public Trim ( ) : void
return void