public DataReferenceBox() : base(BoxTypes.DataReference) { this.Size += 4UL; // entry count this.EntryCount = 1; DataEntry = new DataEntry[1]; DataEntry[0] = new DataEntry(); DataEntry[0].DataEntryUrlBox = new DataEntryUrlBox(); this.Size += DataEntry[0].DataEntryUrlBox.Size; }
public override void Read(BoxReader reader) { using (new SizeChecker(this, reader)) { base.Read(reader); EntryCount = reader.ReadUInt32(); DataEntry = new DataEntry[EntryCount]; for (int i=0; i<EntryCount; i++) { long pos = reader.BaseStream.Position; Box test = new Box(BoxTypes.Any); test.Read(reader); reader.BaseStream.Position = pos; DataEntry entry = new DataEntry(); if (test.Type == BoxTypes.DataEntryUrn) { entry.DataEntryUrnBox = new DataEntryUrnBox(); entry.DataEntryUrnBox.Read(reader); } else if (test.Type == BoxTypes.DataEntryUrl) { entry.DataEntryUrlBox = new DataEntryUrlBox(); entry.DataEntryUrlBox.Read(reader); // if (entry.DataEntryUrlBox.bBug == true) this.Size += 1; } else { test.Read(reader); // skip Debug.WriteLine(string.Format("Unknown box type {0} in DataReferenceBox (dref), skipped", test.Type.ToString())); } DataEntry[i] = entry; } } }