BACnet.IP.Bvlc.ForwardedNpduMessage.Serialize C# (CSharp) Method

Serialize() public method

Serializes the message to a buffer
public Serialize ( byte buffer, int offset ) : int
buffer byte The buffer to serialize to
offset int The offset to begin serializing
return int
        public int Serialize(byte[] buffer, int offset)
        {
            if (OriginalMac.Length != 6)
                throw new Exception("OriginalMac must have length 6");

            for (int i = 0; i < OriginalMac.Length; i++)
            {
                buffer[offset++] = OriginalMac[i];
            }

            return offset;
        }