public LhaFileInputStream(LhaFile file, LhaEntry entry) : base(file.binaryReader.BaseStream, file.encoding) { if (file == null || entry == null) { throw new NullReferenceException(); } this.file = file; this.pos = entry.GetOffset(); this.count = entry.GetCompressedSize(); file.binaryReader.BaseStream.Position = this.pos; }
/** * Make entry map in lha file. * * @throws LhaException * if a lha format error has occurred * @throws IOException * if an I/O error has occured */ private void MakeEntryMap() { LhaEntryReader lhaEntryReader = new LhaEntryReader(binaryReader, encoding); this.size = 0; while (true) { LhaEntry e = lhaEntryReader.ReadHeader(); if (e == null) { break; } e.SetOffset(binaryReader.BaseStream.Position); entryList.Add(e); entryMap.Add(e.GetPath(), e); ++size; int skipSize = (int)e.GetCompressedSize(); binaryReader.BaseStream.Position += skipSize; } }