BitConverter: ToInt16

ToInt16

Converts an array of bytes to an Integer value.



 Public Function ToInt16(
	  ByRef Value ( ) As Byte,
	  ByVal StartIndex As Long ) As Integer

Parameters

Value
[ByRef] Byte. The array of bytes used to create an integer from.
StartIndex
[ByVal] Long. The starting byte in the array to create an integer from.

Return Values

Integer -  Integer data-type representation of the 2 bytes used in the array.

Exceptions

ExceptionCondition
ArgumentExceptionStartIndex is greater than or equal to the length of Value minus 1, and is less than or equal to the length of Value minus 1.
ArgumentNullExceptionValue is uninitialized.
ArgumentOutOfRangeExceptionStartIndex is less than zero or greater than the length of Value minus 1.

See Also

Project CorLib Overview

Class BitConverter Overview