/// <summary> /// Update the header data from the given byte array. /// </summary> /// <param name="data">Byte representation of the header data /// structure.</param> public void UpdateData(byte[] data) { this.data = StructureConverter.BytesToStructure < SimpleMessageHeaderData>(data); }
/// <summary> /// Convert a byte array to a structure of the given type. /// </summary> /// <typeparam name="T">The type of structure that is contained in /// <paramref name="bytes"/>.</typeparam> /// <param name="bytes">An array holding the bytes of the /// structure.</param> /// <returns>The structure contained in <paramref name="bytes"/>. /// </returns> public static T BytesToStructure <T>(byte[] bytes) where T : struct { return(StructureConverter.BytesToStructure <T>(bytes, 0)); }