Skip to content

StreamExtensions.ReadUInt16OrThrow Method

Definition

Reads a UInt16 from the stream, throwing EndOfStreamException if the end of the stream has been reached.

public static ushort ReadUInt16OrThrow(this Stream stream, Endian endian = Endian.MrKWatkins.BinaryPrimitives.Endian);

View source

Parameters

Name Type Description
stream Stream
endian Endian The endianness to use.

Returns

UInt16

The UInt16 value read from the stream.