是否需要使用多个gzip成员进行大于4GB的输入? [英] Is it necessary to use multiple gzip members for input larger than 4GB?

查看:112
本文介绍了是否需要使用多个gzip成员进行大于4GB的输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过统计


功能:

Features:


  • 没有4GB限制

...

Idzip仅使用多个gzip成员来限制文件大小。

Idzip just uses multiple gzip members to have no file size limit.

idzip的作者似乎暗示着多个gzip成员是需要支持大于4GB的数据。

the author of idzip seems to imply that multiple gzip members are necessary to support data > 4GB.

但是 deflate算法,其输出gzip成员仅使用页眉和页脚进行包装,显然支持超过4GB的输入。

But the deflate algorithm, whose output gzip members merely wrap with header and footer, evidently supports more than 4GB of input.

那么真的有必要使用多个gzip成员来压缩4GB以上的数据吗?

So is it really necessary to use multiple gzip members to compress more than 4GB of data?

推荐答案

甚至.net的 GZipStream es不支持多个成员(与 spec btw相反),但仍支持gzip文件具有更大的4GB,现在(自.net 4.0 起)的基础 DeflateStream 支持它。

Even .net's GZipStream, which does not support multiple members (contrary to the spec btw), nevertheless supports gzip files with more 4GB, now that (since .net 4.0) the underlying DeflateStream supports it.

因此可以密封它:输入大于4GB的文件不需要多个gzip成员。

gzip规范不要限制大小:

  Each member has the following structure:

     +---+---+---+---+---+---+---+---+---+---+
     |ID1|ID2|CM |FLG|     MTIME     |XFL|OS | (more-->)
     +---+---+---+---+---+---+---+---+---+---+

... [omitting optional headers]

     +=======================+
     |...compressed blocks...| (more-->)
     +=======================+

       0   1   2   3   4   5   6   7
     +---+---+---+---+---+---+---+---+
     |     CRC32     |     ISIZE     |
     +---+---+---+---+---+---+---+---+

     ISIZE (Input SIZE)
        This contains the size of the original (uncompressed) input
        data modulo 2^32.

这里重要的部分是


原始(未压缩)输入数据的大小模2 ^ 32

这篇关于是否需要使用多个gzip成员进行大于4GB的输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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