使用SharpZipLib将文件解压缩到memorystream. [英] Unzip a file to memorystream using SharpZipLib.

查看:477
本文介绍了使用SharpZipLib将文件解压缩到memorystream.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我这里有一个场景,我需要解压缩其中包含一些文件的文件.在这里,我必须直接将该文件提取(解压缩)到内存流中,而不必将其提取到文件夹或其他内容中.不幸的是,我找不到任何直接使用SharpZipLib程序集将文件解压缩到内存流中的源.任何帮助将不胜感激.

,谢谢,

Chowdary.

Hi All,

         I have a scenario here, I need to unzip a file which contains some files in it. Here I have to extract(UnZip) that file into a memorystream directly with out extracting it into a folder or something. Unfortunately I couldn't find any source for me to unzip a file into a memorystream directly using SharpZipLib assembly. Any help would be greatly appreciated.

Thanks,

Chowdary.

推荐答案

SharpZipLib几乎是完全基于流的,因此这不应该那么难,仅库附带的unzipfile示例需要最少的更改(只需撕掉它读取2k块的部分,然后将'm写入磁盘,然后将'm全部读取到内存流中),所以我建议您从那里开始.

SharpZipLib is almost complete streambased so this shouldn't be that hard, the unzipfile example that ships with the library only needs minimal changes (just rip out the part where it reads 2k blocks and write 'm to disk and read 'm all into a memory stream) so i suggest you start from there.


这篇关于使用SharpZipLib将文件解压缩到memorystream.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆