Gemstone Common Library
Show/Hide TOC

# BigEndianToUInt16(Byte, Int32) Method

Returns a 16-bit unsigned integer converted from two bytes, accounting for target endian-order, at a specified position in a byte array.

## Definition

Namespace: Gemstone
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.176 -- Release Build+c74560d581224bfee7a285d73926fb4fb3df8ece
C#
View Source Request Example

    public static ushort ToUInt16(
    	byte[] buffer,
    	int startIndex
    )

VB
View Source Request Example

    Public Shared Function ToUInt16 (
    	buffer As Byte(),
    	startIndex As Integer
    ) As UShort

C++
View Source Request Example

    public:
    static unsigned short ToUInt16(
    	array<unsigned char>^ buffer,
    	int startIndex
    )

JavaScript
View Source Request Example

    Gemstone.BigEndian.ToUInt16 = function(buffer, startIndex);

#### Parameters

buffer Byte
  An array of bytes (i.e., buffer containing binary image of value).
startIndex Int32
  The starting position within value.

#### Return Value

UInt16
A 16-bit unsigned integer formed by two bytes beginning at startIndex.

## Exceptions

ArgumentNullException | value is null.
ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1.

## See Also

#### Reference

BigEndian Class
ToUInt16 Overload
Gemstone Namespace