【问题标题】:What GZip extra field subfields exist?存在哪些 GZip 额外字段子字段?
【发布时间】:2021-03-19 04:22:27
【问题描述】:

RFC 1952(GZIP 文件格式规范section 2.3.1.1 内容如下:

2.3.1.1. Extra field

   If the FLG.FEXTRA bit is set, an "extra field" is present in
   the header, with total length XLEN bytes.  It consists of a
   series of subfields, each of the form:

      +---+---+---+---+==================================+
      |SI1|SI2|  LEN  |... LEN bytes of subfield data ...|
      +---+---+---+---+==================================+

   SI1 and SI2 provide a subfield ID, typically two ASCII letters
   with some mnemonic value.  Jean-Loup Gailly
   <email@hidden> is maintaining a registry of subfield
   IDs; please send him any subfield ID you wish to use.  Subfield
   IDs with SI2 = 0 are reserved for future use.  The following
   IDs are currently defined:

      SI1         SI2         Data
      ----------  ----------  ----
      0x41 ('A')  0x70 ('P')  Apollo file type information

   LEN gives the length of the subfield data, excluding the 4
   initial bytes.

除了 RFC 中给出的AP 之外,是否存在任何子字段类型?网络搜索找不到列表; GZip 的 Wikipedia 页面、GNU 主页、gzip 源代码或 Stack Overflow 上也没有任何提及。

【问题讨论】:

    标签: gzip file-format


    【解决方案1】:

    据我所知,没有维护这样的注册表。 Jean-loup 不再适用于 gzip。

    【讨论】:

    • 鉴于您的凭据,这个答案是权威的(没有双关语的意思)。
    【解决方案2】:

    这里还有一个正在使用的子字段:

    为用于生物信息学而开发的 BGZF 格式(符合 gzip 标准)使用子字段类型“BC”来指示当前块的大小。这用于使并行解压缩变得容易。

    来自http://samtools.github.io/hts-specs/SAMv1.pdf 的规范:

    每个 BGZF 块都包含一个标准 gzip 文件头,并带有以下符合标准的扩展名:

    1. 标头中的 F.EXTRA 位设置为指示存在额外字段。
    2. BGZF 使用的额外字段使用两个子字段 ID 值 66 和 67(ASCII ‘BC’)。
    3. BGZF 额外字段有效载荷(gzip 规范中的字段 LEN)的长度为 2(两个字节 有效载荷)。
    4. BGZF 额外字段的有效负载是小端格式的 16 位无符号整数。这个整数 给出包含 BGZF 块的大小减一。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-22
      • 2011-11-09
      • 1970-01-01
      • 2013-06-18
      • 2013-06-24
      相关资源
      最近更新 更多