INumericBitConverterTNumeric Interface

Converts numeric values to arrays of bytes, and an array of bytes to numeric values.

Definition

Namespace: Jodosoft.Numerics
Assembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public interface INumericBitConverter<TNumeric>
where TNumeric : struct, new(), INumeric<TNumeric>

Type Parameters

TNumeric
The type of numeric value to convert.

Properties

ConvertedSize Returns the number of bytes that will be used to ToNumeric(Byte, Int32) to form a numeric value, which is also the length of byte arrays returned by GetBytes(TNumeric).

Methods

GetBytes Returns the specified numeric value as an array of bytes.
ToNumeric(ReadOnlySpanByte) Converts a read-only byte span into a numeric value.
ToNumeric(Byte, Int32) Returns a numeric value converted from bytes at a specified position in a byte array. The number of bytes can be obtained from the ConvertedSize method.
TryWriteBytes Converts a numeric value into a span of bytes.

See Also