1

ZIP 文件格式支持多种压缩算法并为其分配编号,例如 0 是 store,8 是 deflate,14 是 lzma。什么数字表示 Brotli 压缩?此压缩算法是否需要任何额外的 zip 级元数据?

4

1 回答 1

1

在撰写本文时,还没有。ZIP 文件格式压缩方法的官方列表可在PKWare 的 ZIP Appnote中找到,其最新版本为 6.3.4,日期为 2014 年 10 月 1 日。以下是其中定义的压缩方法:

   4.4.5 compression method: (2 bytes)

        0 - The file is stored (no compression)
        1 - The file is Shrunk
        2 - The file is Reduced with compression factor 1
        3 - The file is Reduced with compression factor 2
        4 - The file is Reduced with compression factor 3
        5 - The file is Reduced with compression factor 4
        6 - The file is Imploded
        7 - Reserved for Tokenizing compression algorithm
        8 - The file is Deflated
        9 - Enhanced Deflating using Deflate64(tm)
       10 - PKWARE Data Compression Library Imploding (old IBM TERSE)
       11 - Reserved by PKWARE
       12 - File is compressed using BZIP2 algorithm
       13 - Reserved by PKWARE
       14 - LZMA (EFS)
       15 - Reserved by PKWARE
       16 - Reserved by PKWARE
       17 - Reserved by PKWARE
       18 - File is compressed using IBM TERSE (new)
       19 - IBM LZ77 z Architecture (PFS)
       97 - WavPack compressed data
       98 - PPMd version I, Rev 1

我想您可以定义自己的方法编号并使用它,但这种使用是非标准的。(这是一个两字节的字段,因此您可以选择一个 PKWare 不太可能将其定义为其他内容的大数字。)

不,解压缩 brotli 流不需要其他信息。

于 2016-08-19T05:03:10.990 回答