BonCodeAJP13Namespace.BonCodeAJP13Packet.GetUInt16 C# (CSharp) Method

GetUInt16() protected static method

Get the UInt16 value from the array starting from the position Pos
protected static GetUInt16 ( byte Data, UInt16 &Value, int Pos ) : int
Data byte
Value System.UInt16
Pos int
return int
        protected static int GetUInt16(byte[] Data, ref UInt16 Value, int Pos)
        {
            byte[] ValueData = new byte[sizeof(UInt16)];
            Array.Copy(Data, Pos, ValueData, 0, sizeof(UInt16));

            // flipping the Array .... Big Endian ..
            ValueData = FlipArray(ValueData);
            Value = BitConverter.ToUInt16(ValueData, 0);
            return Pos + sizeof(UInt16);
        }