public override void Read(BinaryReader reader, ulong baselength = 0)
{
InputOffset = (ulong)reader.BaseStream.Position - (ulong)MatroskaExtensions.IdSize(Id);
ulong length;
if (baselength == 0)
reader.Ebml_Read_Length(out length);
else
length = baselength;
InputValueOffset = (ulong)reader.BaseStream.Position;
while (length > 0)
{
ulong coffset = (ulong)reader.BaseStream.Position;
ulong head;
reader.Ebml_Read_Id(4, out head);
bool found = false;
List<EbmlGeneric> ls=new List<EbmlGeneric>();
ls.AddRange(Available);
ls.AddRange(Container.General);
foreach (EbmlGeneric k in ls)
{
if (k.Id == head)
{
EbmlGeneric c = k.New();
Value.Add(c);
c.Read(reader);
found = true;
break;
}
}
if (!found)
throw new IOException(string.Format("Unknown header {0:X}", head));
length -= (ulong)reader.BaseStream.Position - coffset;
}
Value.Sort();
}