public byte[] GetData() { byte[] returned; using (MemoryStream MS = new MemoryStream()) { BinaryWriter writer = new BinaryWriter(MS); Header.FileSize = 1 + Header.HeaderSize + Palette.Size + Reserved.Size + Compressed.Size(); Header.Get(writer); Palette.Get(writer); WidthTable.Get(writer); Unknown.Get(writer); Reserved.Get(writer); Compressed.Get(writer); if (Last != null) { Header.LastPosition = Last.Get(writer); writer.BaseStream.Position = 0; Header.Get(writer); } returned = MS.ToArray(); } return(returned); }