BonCodeAJP13Namespace.BonCodeAJP13Packet.GetInt16 C# (CSharp) Метод

GetInt16() защищенный статический Метод

Get the Int16 value from the array starting from the position Pos
protected static GetInt16 ( byte Data, Int16 &Value, int Pos ) : int
Data byte
Value System.Int16
Pos int
Результат int
        protected static int GetInt16(byte[] Data, ref Int16 Value, int Pos)
        {
            byte[] ValueData = new byte[sizeof(Int16)];
            Array.Copy(Data, Pos, ValueData, 0, sizeof(Int16));

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