Skip to content

ByteSpanExtensions.GetUInt16 Method

Overloads

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

GetUInt16(Span<Byte>)

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

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

View source

Parameters

Name Type Description
bytes Span<Byte>

Returns

UInt16

The UInt16 value.

GetUInt16(Span<Byte>, Endian)

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

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

View source

Parameters

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

Returns

UInt16

The UInt16 value.