예제 #1
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32((uint)Entries.Length);

            for (var i = 0; i < Entries.Length; i++)
            {
                ref TimeToSampleEntry entry = ref Entries[i];

                stream.WriteBEUInt32(entry.SampleCount);
                stream.WriteBEUInt32(entry.SampleDelta);
            }
예제 #2
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            uint entryCount = stream.ReadBEUInt32();

            this.Entries = new TimeToSampleEntry[entryCount];

            for (uint i = 0; i < entryCount; i++)
            {
                Entries[i] = new TimeToSampleEntry(
                    sampleCount: stream.ReadBEUInt32(),
                    sampleDelta: stream.ReadBEUInt32()
                    );
            }
        }