public static IEnumerable <PboEntry> EnumerateEntries(Stream s) { var reader = new BinaryReader(s, System.Text.Encoding.ASCII, true); var entries = new List <PboEntry>(); while (true) { var pboEntry = new PboEntry(); pboEntry.ReadHeader(reader); if (pboEntry.Path.Length == 0) { if (entries.Count != 0) { break; } while (reader.ReadStringZ().Length != 0) { } } else { entries.Add(pboEntry); } } foreach (var current in entries) { current.ReadBodySeq(reader); yield return(current); } }
protected void ReadPboHeader(BinaryReader reader) { while (true) { var pboEntry = new PboEntry(); pboEntry.ReadHeader(reader); if (pboEntry.Path.Length == 0) { if (entries.Count != 0) { break; } string s; while ((s = reader.ReadStringZ()).Length != 0) { extensions.Add(s); } } else { entries.Add(pboEntry); } } }