SevenZipSharp icon indicating copy to clipboard operation
SevenZipSharp copied to clipboard

Is it possible to extract only part of a file?

Open axzxc1236 opened this issue 5 years ago • 1 comments

I have a use case that needs to process part of a file at a time

e.g. I have a compressed file that is 1GB after extracted, I have a code that access 0byte ~ 10Mbyte at first iteration, 10Mbyte ~ 20Mbyte at second iteration, is it possible to extract only a chunk of a file?
I currently using something like

MemoryStream mstream = new MemoryStream();
mstream = extractor.ExtractFile(filename, mstream);

which puts the whole file in RAM.

axzxc1236 avatar Apr 06 '20 13:04 axzxc1236

While I'm by no means an expert on 7z, I don't believe there's a way to extract only a given set of bytes from an archive...

As SevenZipSharp looks right now there's no way to achieve this, and given answers like these I don't think it's possible, for 7z at least.

squid-box avatar Apr 07 '20 19:04 squid-box