public XLDNavigator(Stream input)
{
if(input == null)throw new ArgumentNullException("input");
baseStream = input;
BinaryReader reader = new BinaryReader(input);
if(XLDFile.Signature != new String(reader.ReadChars(6)))
{
input.Close();
throw new InvalidDataException("This is not valid XLD file.");
}
nEntries = reader.ReadInt16();
entriesLengths = new int[nEntries];
entriesPos = new int[nEntries];
int actpos = 0;
for(int i = 0; i < nEntries; i++)
{
entriesLengths[i] = reader.ReadInt32();
entriesPos[i] = actpos;
actpos += entriesLengths[i];
}
if(input.CanSeek)streamStart = input.Position;
CurrentSubfile = 0;
remaining = entriesLengths[0];
}