.NET 中的 DeflateStream 4GB 限制
来自 MSDN:DeflateStream 类
DeflateStream 不能用于压缩大于 4 GB 的文件。
是否有任何其他没有 4 GB 限制的 .NET 实现?
注意:我确实需要解压缩内容大于 4 GB 的 GZ 格式文件。 任何代码都可以做到这一点吗?
From MSDN: DeflateStream Class
DeflateStream cannot be used to compress files larger than 4 GB.
Are there any other implementations for .NET without the 4 GB limit?
NOTE: I really need to decompress a file in GZ format with content larger than 4 GB. Can any code do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
仅供参考,我们已删除 .NET 4 中 DeflateStream 的 4 GB 限制。
FYI, we have removed the 4 GB limit from DeflateStream in .NET 4.
CodeProject 上有使用 7-Zip 库的示例代码。
该许可证是开放的,因此您应该能够在您的项目中使用它。
7-Zip 还支持 GZ 文件。
There is sample code at CodeProject using the 7-Zip library.
The license is open, so you should be able to use this in your project.
7-Zip also supports GZ files.
查看 SharpZipLib。 不确定它是否受到相同的限制,但值得一看。
Take a look at SharpZipLib. Not sure if it's subject to the same limitation, but worth a look.
查找支持 DEFLATE64 的库(不是 Zip64,它是 ZIP 文件格式的扩展)。 Xceed Zip for .NET 确实支持 Deflate64,我相信其他人也支持。
Look for libraries that support DEFLATE64 (not Zip64, that's an extension to the ZIP file format). Xceed Zip for .NET does support Deflate64, and I'm sure others do too.
看了一圈,好像很多人都遇到过这个问题。
系统。 IO.Compressio.DeflateStream 请澄清 似乎是最全面的。
我能找到的唯一可以通过使用 Zip64 来克服这个问题的实现是
Xceed Zip for .NET。
但是,它非常昂贵,我不确定它是否适合您的需求。
编辑:
似乎确实有很多 .NET 的 Zip64 实现,但我找不到任何免费的。
Having a look around, it seems a lot of people have encountered this problem.
System.IO.Compressio.DeflateStream clarifications please seems to be the most comprehensive.
The only implementation I was able to find that seems to overcome this problem by using Zip64 is
Xceed Zip for .NET.
However, it is very expensive and I am not sure if it would suite your needs.
Edit:
There does seem to be quite a number of implementations of Zip64 for .NET, but I can't find any that are free.
DotNetZip 为 .NET 提供 ZIP64,而且是免费的。 但 Zip64 与 Deflate64 不同。
DotNetZip does ZIP64 for .NET, and it is free. But Zip64 is not the same as Deflate64.
尽管该文档表示 DeflateStream 和 GZipStream 都有 4GB 限制,但由于 CRC32 校验和,只有 GZipStream 受到限制。 如果不需要 CRC32,则使用 DeflateStream。
Although that documentation says the 4GB limitation is for both the DeflateStream and GZipStream, only GZipStream is limited because of the CRC32 checksum. If you do not need CRC32 then use DeflateStream.