Interface IDeviceBinaryFieldFormatter<T>

Namespace
ProtoTest.Devices
Assembly
ProtoTest.Devices.dll

Converts one binary field of type T to and from a fixed number of bytes.

public interface IDeviceBinaryFieldFormatter<T>

Type Parameters

T
Extension Methods

Properties

Size

Gets how many bytes the field takes.

int Size { get; }

Property Value

int

Methods

Read(ReadOnlySpan<byte>, bool)

Reads the value from exactly Size bytes.

T Read(ReadOnlySpan<byte> source, bool bigEndian)

Parameters

source ReadOnlySpan<byte>
bigEndian bool

Returns

T

Write(T, Span<byte>, bool)

Writes the value into exactly Size bytes.

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

Parameters

value T
destination Span<byte>
bigEndian bool