Class DeviceFormatters.ScaledInt32

Namespace
ProtoTest.Devices
Assembly
ProtoTest.Devices.dll

A decimal stored as a signed 32-bit value scaled by 10^decimals.

public abstract class DeviceFormatters.ScaledInt32 : IDeviceBinaryFieldFormatter<decimal>
Inheritance
DeviceFormatters.ScaledInt32
Implements
Inherited Members
Extension Methods

Constructors

ScaledInt32(int)

A decimal stored as a signed 32-bit value scaled by 10^decimals.

protected ScaledInt32(int decimals)

Parameters

decimals int

Properties

Size

Gets how many bytes the field takes.

public int Size { get; }

Property Value

int

Methods

Read(ReadOnlySpan<byte>, bool)

Reads the value from exactly Size bytes.

public decimal Read(ReadOnlySpan<byte> source, bool bigEndian)

Parameters

source ReadOnlySpan<byte>
bigEndian bool

Returns

decimal

Write(decimal, Span<byte>, bool)

Writes the value into exactly Size bytes.

public void Write(decimal value, Span<byte> destination, bool bigEndian)

Parameters

value decimal
destination Span<byte>
bigEndian bool