.NET ZIP 库在内存中工作
是否有 .NET 在内存中工作的 ZIP 库?
我需要压缩和解压缩文件,而不需要在硬盘上存储临时文件。只需在内存中构建存档并返回内存流即可。然后接收内存流并且不将zip存档存储在硬盘上解压缩文件并保存它。
Is there a ZIP library for .NET working inmemory?
I need to zip and unzip files without temporary files stored on hdd. Just build archive in memory and return memory stream. Then receive memory stream and without storing zip archive on hdd unzip file and save it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
DotNetZip 库 支持内存中工作。
以下是一些示例
The DotNetZip Library supports working In-Memory.
Here are some Examples
据我所知, SharpZipLib 应该可以很好地写入
MemoryStream
我知道。老实说,如果看到任何需要写入物理文件的 zip 库,我都会感到非常惊讶。很可能有“将文件添加到存档”的便捷方法,但我在各种平台上看到的所有 API 都允许您添加带有自定义数据的手动创建的 zip 文件条目。SharpZipLib should work fine writing to a
MemoryStream
as far as I'm aware. To be honest, I'd be quite surprised to see any zip library which required you to write to a physical file. There may well be convenience methods to "add a file to the archive" but all the APIs I've seen on various platforms have allowed you to add a manually-created zip file entry with custom data.自 v 3.0 起,.NET 框架中的
WindowsBase
dll 就有了ZipPackage
类。The
WindowsBase
dll in the .NET framework has had aZipPackage
class since v 3.0.