C# Класс Gurux.DLMS.GXByteBuffer

Byte array class is used to save received bytes.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Add() публичный Метод

Add new object to the byte buffer.
public Add ( object value ) : void
value object Value to add.
Результат void

Array() публичный Метод

Returs data as byte array.
public Array ( ) : byte[]
Результат byte[]

Clear() публичный Метод

Clear buffer but do not release memory.
public Clear ( ) : void
Результат void

Compare() публичный Метод

Compares, whether two given arrays are similar starting from current position.
public Compare ( byte arr ) : bool
arr byte Array to compare.
Результат bool

Get() публичный Метод

Get value from the byte array.
public Get ( byte target ) : void
target byte Target array.
Результат void

GetDouble() публичный Метод

Get double value from byte array from the current position and then increments the position.
public GetDouble ( ) : double
Результат double

GetFloat() публичный Метод

Get float value from byte array from the current position and then increments the position.
public GetFloat ( ) : float
Результат float

GetInt16() публичный Метод

Get Int16 value from byte array from the current position and then increments the position.
public GetInt16 ( ) : Int16
Результат System.Int16

GetInt16() публичный Метод

Get Int16 value from byte array.
public GetInt16 ( int index ) : Int16
index int Byte index.
Результат System.Int16

GetInt32() публичный Метод

Get UInt32 value from byte array from the current position and then increments the position.
public GetInt32 ( ) : Int32
Результат System.Int32

GetInt64() публичный Метод

Get Int64 value from byte array from the current position and then increments the position.
public GetInt64 ( ) : System.Int64
Результат System.Int64

GetInt8() публичный Метод

Get Int8 value from byte array from the current position and then increments the position.
public GetInt8 ( ) : sbyte
Результат sbyte

GetString() публичный Метод

Get String value from byte array.
public GetString ( int count ) : string
count int Byte count.
Результат string

GetString() публичный Метод

Get String value from byte array.
public GetString ( int index, int count ) : string
index int Byte index.
count int Byte count.
Результат string

GetStringUtf8() публичный Метод

Get String value from byte array.
public GetStringUtf8 ( int index, int count ) : string
index int Byte index.
count int Byte count.
Результат string

GetUInt16() публичный Метод

Get UInt16 value from byte array from the current position and then increments the position.
public GetUInt16 ( ) : UInt16
Результат System.UInt16

GetUInt16() публичный Метод

Get UInt16 value from byte array.
public GetUInt16 ( int index ) : UInt16
index int Byte index.
Результат System.UInt16

GetUInt32() публичный Метод

Get UInt32 value from byte array from the current position and then increments the position.
public GetUInt32 ( ) : UInt32
Результат System.UInt32

GetUInt32() публичный Метод

Get Int32 value from byte array.
public GetUInt32 ( int index ) : UInt32
index int Byte index.
Результат System.UInt32

GetUInt64() публичный Метод

Get UInt64 value from byte array from the current position and then increments the position.
public GetUInt64 ( ) : System.UInt64
Результат System.UInt64

GetUInt8() публичный Метод

Get UInt8 value from byte array from the current position and then increments the position.
public GetUInt8 ( ) : byte
Результат byte

GetUInt8() публичный Метод

Get UInt8 value from byte array.
public GetUInt8 ( int index ) : byte
index int Byte index.
Результат byte

Move() публичный Метод

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.
Результат void

Set() публичный Метод

public Set ( GXByteBuffer value ) : void
value GXByteBuffer
Результат void

Set() публичный Метод

Set new value to byte array.
public Set ( GXByteBuffer value, int count ) : void
value GXByteBuffer Byte array to add.
count int Byte count.
Результат void

Set() публичный Метод

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.
Результат void

Set() публичный Метод

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.
Результат void

Set() публичный Метод

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.
Результат void

SetDouble() публичный Метод

Set float value to byte array.
public SetDouble ( double value ) : void
value double
Результат void

SetFloat() публичный Метод

Set float value to byte array.
public SetFloat ( float value ) : void
value float
Результат void

SetHexString() публичный Метод

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.
Результат void

SetHexString() публичный Метод

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.
Результат void

SetHexString() публичный Метод

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.
Результат void

SetInt16() публичный Метод

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.
Результат void

SetInt16() публичный Метод

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.
Результат void

SetInt32() публичный Метод

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.
Результат void

SetInt32() публичный Метод

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
Результат void

SetInt64() публичный Метод

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.
Результат void

SetInt64() публичный Метод

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
Результат void

SetUInt16() публичный Метод

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.
Результат void

SetUInt16() публичный Метод

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.
Результат void

SetUInt32() публичный Метод

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.
Результат void

SetUInt32() публичный Метод

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
Результат void

SetUInt64() публичный Метод

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.
Результат void

SetUInt64() публичный Метод

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
Результат void

SetUInt8() публичный Метод

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.
Результат void

SetUInt8() публичный Метод

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.
Результат void

SubArray() публичный Метод

Returns data as byte array.
public SubArray ( int index, int count ) : byte[]
index int
count int
Результат byte[]

ToString() публичный Метод

public ToString ( ) : string
Результат string

Trim() публичный Метод

Remove handled bytes.
This can be used in debugging to remove handled bytes.
public Trim ( ) : void
Результат void