Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all articles
Browse latest Browse all 239

New Post: accessing a file directly

$
0
0

You probably ought not to use the Reader for random access.  Use the ArchiveFactory for that.

Here's a sample with LINQ (I haven't actually tried this so the code might not be 100%)

var archive = ArchiveFactory.Open(stream);var file = archive.Entries.Where(x => x.Name == "myfolder/myfile.txt").FirstOrDefault();

However, for a reader you'd have to manually loop like this:

var reader = ReaderFactory.Open(stream); while(reader.MoveToNextEntry() && reader.Entry.Name == "") { ... }


Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>