protected override void SaveToStream(Stream stream) { base.SaveToStream(stream); stream.WriteBEUInt32((uint)Entries.Length); for (int i = 0; i < Entries.Length; i++) { ref CompositionOffsetEntry entry = ref Entries[i]; stream.WriteBEUInt32(entry.SampleCount); stream.WriteBEUInt32(entry.SampleOffset); }
protected override void LoadFromStream(Stream stream) { base.LoadFromStream(stream); uint entryCount = stream.ReadBEUInt32(); Entries = new CompositionOffsetEntry[entryCount]; for (uint i = 0; i < entryCount; i++) { Entries[i] = new CompositionOffsetEntry( sampleCount: stream.ReadBEUInt32(), sampleOffset: stream.ReadBEUInt32() ); } }