Skip to content

ByteReadOnlySpanExtensions.GetUInt16 Method

Overloads

Name Description
GetUInt16(ReadOnlySpan<Byte>) Reads a little-endian UInt16 from a read-only span of bytes.
GetUInt16(ReadOnlySpan<Byte>, Endian) Reads a UInt16 from a read-only span of bytes using the specified endianness.

GetUInt16(ReadOnlySpan<Byte>)

Reads a little-endian UInt16 from a read-only span of bytes.

public static ushort GetUInt16(this ReadOnlySpan<Byte> bytes);

View source

Parameters

Name Type Description
bytes ReadOnlySpan<Byte>

Returns

UInt16

The UInt16 value.

GetUInt16(ReadOnlySpan<Byte>, Endian)

Reads a UInt16 from a read-only span of bytes using the specified endianness.

public static ushort GetUInt16(this ReadOnlySpan<Byte> bytes, Endian endian);

View source

Parameters

Name Type Description
bytes ReadOnlySpan<Byte>
endian Endian The endianness to use.

Returns

UInt16

The UInt16 value.