public ReaderDirectory(IsoContext context, ReaderDirEntry dirEntry) : base(context, dirEntry) { byte[] buffer = new byte[context.SectorSize]; Stream extent = new ExtentStream(_context.DataStream, dirEntry.Record.LocationOfExtent, uint.MaxValue, 0, 0, context.SectorSize); _records = new List <ReaderDirEntry>(); uint totalLength = dirEntry.Record.DataLength; uint totalRead = 0; while (totalRead < totalLength) { int bytesRead = (int)Math.Min(buffer.Length, totalLength - totalRead); extent.Seek(24, SeekOrigin.Current); StreamUtilities.ReadExact(extent, buffer, 0, bytesRead); totalRead += (uint)bytesRead; uint pos = 0; while (pos < bytesRead && buffer[pos] != 0) { DirectoryRecord dr; uint length = (uint)DirectoryRecord.ReadFrom(buffer, (int)pos, context.VolumeDescriptor.CharacterEncoding, out dr); if (!IsoUtilities.IsSpecialDirectory(dr)) { ReaderDirEntry childDirEntry = new ReaderDirEntry(_context, dr); if (context.SuspDetected && !string.IsNullOrEmpty(context.RockRidgeIdentifier)) { if (childDirEntry.SuspRecords == null || !childDirEntry.SuspRecords.HasEntry(context.RockRidgeIdentifier, "RE")) { _records.Add(childDirEntry); } } else { _records.Add(childDirEntry); } } else if (dr.FileIdentifier == "\0") { Self = new ReaderDirEntry(_context, dr); } pos += length; } } }