C# Class Gurux.DLMS.GXByteBuffer

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

Méthodes publiques

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

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

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

Array() public méthode

Returs data as byte array.
public Array ( ) : byte[]
Résultat byte[]

Clear() public méthode

Clear buffer but do not release memory.
public Clear ( ) : void
Résultat void

Compare() public méthode

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

Get() public méthode

Get value from the byte array.
public Get ( byte target ) : void
target byte Target array.
Résultat void

GetDouble() public méthode

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

GetFloat() public méthode

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

GetInt16() public méthode

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

GetInt16() public méthode

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

GetInt32() public méthode

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

GetInt64() public méthode

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

GetInt8() public méthode

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

GetString() public méthode

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

GetString() public méthode

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

GetStringUtf8() public méthode

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

GetUInt16() public méthode

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

GetUInt16() public méthode

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

GetUInt32() public méthode

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

GetUInt32() public méthode

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

GetUInt64() public méthode

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

GetUInt8() public méthode

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

GetUInt8() public méthode

Get UInt8 value from byte array.
public GetUInt8 ( int index ) : byte
index int Byte index.
Résultat byte

Move() public méthode

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

Set() public méthode

public Set ( GXByteBuffer value ) : void
value GXByteBuffer
Résultat void

Set() public méthode

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

Set() public méthode

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

Set() public méthode

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

Set() public méthode

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

SetDouble() public méthode

Set float value to byte array.
public SetDouble ( double value ) : void
value double
Résultat void

SetFloat() public méthode

Set float value to byte array.
public SetFloat ( float value ) : void
value float
Résultat void

SetHexString() public méthode

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

SetHexString() public méthode

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

SetHexString() public méthode

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

SetInt16() public méthode

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

SetInt16() public méthode

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

SetInt32() public méthode

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

SetInt32() public méthode

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

SetInt64() public méthode

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

SetInt64() public méthode

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

SetUInt16() public méthode

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

SetUInt16() public méthode

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

SetUInt32() public méthode

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

SetUInt32() public méthode

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

SetUInt64() public méthode

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

SetUInt64() public méthode

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

SetUInt8() public méthode

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

SetUInt8() public méthode

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

SubArray() public méthode

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

ToString() public méthode

public ToString ( ) : string
Résultat string

Trim() public méthode

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