BonCodeAJP13.BonCodeAJP13ServerConnection.GetInt16B C# (CSharp) Method

GetInt16B() private method

Get the Int16 value from the array starting from the pos pos Using unsigned integers only range from 0 to 65,535
private GetInt16B ( byte Data, int Pos ) : int
Data byte
Pos int
return int
        private int GetInt16B(byte[] Data, int Pos)
        {
            UInt16 Value = 0;
            byte[] ValueData = new byte[sizeof(Int16)];
            Array.Copy(Data, Pos, ValueData, 0, sizeof(Int16));

            //flipping for BigEndian conversion prep
            ValueData = FlipArray(ValueData);
            //Value = BitConverter.ToInt16(ValueData, 0);
            Value = BitConverter.ToUInt16(ValueData, 0);
            return (int) Value;
        }