/// <summary> /// Initialises a new message from the rawData buffer. /// </summary> public Message(byte[] rawData) { ushort service = AMessageData.ToShort(rawData[4], rawData[5]); _header = new MessageHeader((ServiceTypes)service); _data = new byte[rawData.Length - MessageHeader.HEADER_SIZE]; Array.Copy(rawData, MessageHeader.HEADER_SIZE, _data, 0, rawData.Length - MessageHeader.HEADER_SIZE); }
/// <summary> /// Initialises a new message with the specified header and data. /// </summary> public Message(MessageHeader header, AMessageData messageData) { _header = header; _data = messageData.Serialize(); }
/// <summary> /// Initialises a new message with the specified header and data. /// </summary> public Message(MessageHeader header, byte[] data) { _header = header; _data = data; }