I have a memory stream that contains a zip file in byte[] format. Is there any way I can unzip this memory stream, without any need of writing the file to disk?
In general I am using ICSharpCode.SharpZipLib.Zip.FastZip to unzip a file, but is there any way to unzip a memory stream, maybe by storing the files in another MemoryStream or in byte[] format according to the files/folders present in the zip?
Any way I can use the Memorymapped files feature in this scenario ?
We use DotNetZip, and I can unzip the contents of a zip file from a
Streaminto memory. Here’s the sample code for extracting a specifically named file from a stream (LocalCatalogZip) and returning a stream to read that file, but it’d be easy to expand on it.It’s not the library you’re using now, but if you can change, you can get that functionality.
Here’s a variation which would return a
Dictionary<string,MemoryStream>of for the contents of every file of a zip file.