Indexed Entry Table #486

Closed
opened 2026-01-29 22:12:49 +00:00 by claunia · 2 comments
Owner

Originally created by @GihanSoft on GitHub (Dec 23, 2021).

Is anyway to save each entry index so app not need to iterate all of archive each time need one of entries?
now I do this:

while (reader.MoveToNextEntry() && !reader.Entry.Key.Equals(name, StringComparison.OrdinalIgnoreCase))
{
}
reader.WriteEntryTo(memStream);

I like something like this:

IIndexedEntryTable entryTable = reader.CreateIndexedEntryTable();
entryTable[name].WriteEntryTo(memStream);
Originally created by @GihanSoft on GitHub (Dec 23, 2021). Is anyway to save each entry index so app not need to iterate all of archive each time need one of entries? now I do this: ```csharp while (reader.MoveToNextEntry() && !reader.Entry.Key.Equals(name, StringComparison.OrdinalIgnoreCase)) { } reader.WriteEntryTo(memStream); ``` I like something like this: ```csharp IIndexedEntryTable entryTable = reader.CreateIndexedEntryTable(); entryTable[name].WriteEntryTo(memStream); ```
claunia added the question label 2026-01-29 22:12:49 +00:00
Author
Owner

@adamhathcock commented on GitHub (Dec 24, 2021):

Readers are useful for forward only streams. If you're iterating over the stream multiple times, then it's probably not a forward-only stream.

Use the Archive interface which indexes entries for random access.

@adamhathcock commented on GitHub (Dec 24, 2021): Readers are useful for forward only streams. If you're iterating over the stream multiple times, then it's probably not a forward-only stream. Use the Archive interface which indexes entries for random access.
Author
Owner

@GihanSoft commented on GitHub (Dec 24, 2021):

Tank you. this lib is really great and helpful.

@GihanSoft commented on GitHub (Dec 24, 2021): Tank you. this lib is really great and helpful.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#486