My app loads RAR/ZIP archives that contain a large number of images and displays a thumbnail in a Listbox. I'm using SevenZipSharp at the moment. Afaik it only supports dumping individual files to disk - which I'll have to do for each image to get a thumbnail. I think dumping the images to memory will give me at least some improvement in performance. Any ideas how to do that?
Asked
Active
Viewed 1,185 times
1 Answers
2
In SevenZipSharp source code, you can see that there are two SevenZipExtractor.ExtractFile()
overloads that takes a System.IO.Stream
object as input type:
public void ExtractFile(string fileName, Stream stream)
// and
public void ExtractFile(int index, Stream stream) // 'index' is the index in the archive file table.
As MemoryStream
inherits from Stream
, you can use one of these functions to achieve what you want.
Note: SevenZipExtractor
has constructors that accept Stream
object also as input type.

Yannick Blondeau
- 9,465
- 8
- 52
- 74
-
Thanks a lot, I should have read the the doc more carefully, thought it only supported FileStreams. – Ferdinand Wörister Oct 03 '12 at 07:07