/// <summary> /// Convert to bytes. /// </summary> /// <returns>Bytes</returns> public byte[] ToBytes() { using (var memStream = new MemoryStream()) using (var writer = new BinaryWriter(memStream)) { ReadWriteUtils.WriteU32(writer, this.Version); // Version 0 writer.Write(this.Hash); writer.Write(ReadWriteUtils.Byteswap32(this.Flags)); return(memStream.ToArray()); } }
/// <summary> /// Convert to bytes. /// </summary> /// <returns>Bytes</returns> public byte[] ToBytes() { using (var memStream = new MemoryStream()) using (var writer = new BinaryWriter(memStream)) { ReadWriteUtils.WriteU32(writer, this.Version); foreach (var color in this.Colors) { writer.Write(color.ToBytesRGB(0)); } return(memStream.ToArray()); } }
/// <summary> /// Convert to bytes. /// </summary> /// <returns>Bytes</returns> public byte[] ToBytes() { using (var memStream = new MemoryStream()) using (var writer = new BinaryWriter(memStream)) { ReadWriteUtils.WriteU32(writer, this.Version); // Version 0 writer.Write(this.Items); writer.Write(this.State); writer.Write(this.Display); return(memStream.ToArray()); } }