Click or drag to resize
BitConverterToUInt16 Method
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static ushort ToUInt16(
	byte[] value,
	int startIndex
)

Parameters

value
Type: SystemByte
The array of bytes.
startIndex
Type: SystemInt32
The starting position within value.

Return Value

Type: UInt16
A 16-bit unsigned integer formed by two bytes beginning at startIndex.
Exceptions
ExceptionCondition
ArgumentExceptionstartIndex equals the length of value minus 1.
ArgumentNullExceptionvalue is null.
ArgumentOutOfRangeExceptionstartIndex is less than zero or greater than the length of value minus 1.
See Also