public void Save(Stream stream) { if (HasTableOfContents) { var header = new LfdHeader { Type = "RMAP", Name = "resource", Length = Entries.Count * 16 }; header.Write(stream); foreach (var entry in Entries) { entry.Header.Write(stream); } } foreach (var entry in Entries) { entry.Header.Write(stream); stream.Write(entry.Data, 0, entry.Data.Length); } IsChanged = false; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsChanged))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CanBeSaved))); }
public void Write(Stream stream) { Header.Write(stream); stream.Write(Data, 0, Header.Length); }