BonCodeAJP13Namespace.BonCodeAJP13Packet.SetByteArray C# (CSharp) Method

SetByteArray() protected static method

Set the byte array in the Data array starting from the position Pos
protected static SetByteArray ( byte Data, byte Value, int Pos, int ArrayLength ) : int
Data byte
Value byte
Pos int
ArrayLength int
return int
        protected static int SetByteArray(byte[] Data, byte[] Value, int Pos, int ArrayLength)
        {
            byte[] LengthArray = new byte[2];
            SetUInt16(LengthArray, (UInt16)Value.Length, 0);

            Array.Copy(LengthArray, 0, Data, Pos, 2);
            Array.Copy(Value, 0, Data, Pos + 2, Value.Length);
            return Pos + Value.Length + 2;
        }