.bz2
Archive
bzip2 压缩
BZ2 文件使用 bzip2 压缩,其压缩比优于 gzip,但速度较慢。它常用于源代码分发和 Linux 包归档,在这些场景中较小的下载量比压缩速度更重要。
MIME 类型
application/x-bzip2
类型
二进制
压缩
无损
优点
- + Better compression ratio than gzip (typically 10-20% smaller)
- + Built-in data integrity checking per block
- + Widely available on Unix/Linux systems
缺点
- − Significantly slower than gzip for both compression and decompression
- − Higher memory usage than gzip
- − Largely superseded by xz and Zstandard for new projects
何时使用 .BZ2
当需要比 gzip 更好的压缩且速度不是关键时使用 bzip2 — 源码包和归档存储。
技术细节
Bzip2 使用 Burrows-Wheeler 变换(BWT),随后是 Move-to-Front 编码和霍夫曼编码。它以 100-900 KB 的块处理数据,块大小控制压缩/内存的权衡。
历史
Julian Seward 于 1996 年创建了 bzip2,实现了 Burrows-Wheeler 块排序压缩。它作为 gzip 的替代品在 Linux 发行版和开源项目中获得了普及。