public static short ToInt16(byte[] array, int index) { CheckByteArgument(array, index, 4); return unchecked((short)ConvertFromBytes(array, index, 2)); }
/// <summary> /// Read specified bit length content as an UInt16 type and increase the bit offset with the specified length. /// </summary> /// <param name="readingLength">Specify the reading bit length.</param> /// <returns>Return the UInt16 value.</returns> public short ReadInt16(int readingLength) { byte[] uint16Bytes = this.GetBytes(readingLength, 2); return(LittleEndianBitConverter.ToInt16(uint16Bytes, 0)); }