BonCodeAJP13Namespace.BonCodeAJP13Packet.SetInt16 C# (CSharp) Method

SetInt16() protected static method

Set the Int16 value in the array starting from the position Pos
protected static SetInt16 ( byte Data, Int16 Value, int Pos ) : int
Data byte
Value System.Int16
Pos int
return int
        protected static int SetInt16(byte[] Data, Int16 Value, int Pos)
        {
            byte[] ValueData = new byte[sizeof(Int16)];
            ValueData = BitConverter.GetBytes(Value);
            // flipping the Array .... Big Endian ..
            ValueData = FlipArray(ValueData);
            Array.Copy(ValueData, 0, Data, Pos, ValueData.Length);
            return Pos + sizeof(Int16);
        }