Skip to content

ByteReadOnlySpanExtensions.GetUInt16 Method ​

Overloads ​

NameDescription
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.

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

View source

Parameters ​

NameTypeDescription
bytesReadOnlySpan<Byte>

Returns ​

UInt16

The UInt16 value.

GetUInt16(ReadOnlySpan<Byte>, Endian) ​

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

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

View source

Parameters ​

NameTypeDescription
bytesReadOnlySpan<Byte>
endianEndianThe endianness to use.

Returns ​

UInt16

The UInt16 value.