BonCodeAJP13Namespace.BonCodeAJP13Packet.SetUInt16 C# (CSharp) Method

SetUInt16() protected static method

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