---
title: bzip2 compressor and decompressor
description: Add asynchronous bzip2 encoding and decoding to loaders.gl format pipelines.
hide_title: true
page_style: designed
---
import {DocPageHeader} from '@site/src/components/docs/doc-page-header';
import {DocOrientation, ReferenceBoundary} from '@site/src/components/docs/designed-doc';
# bzip2 Compressor and Decompressor
`BZip2Compressor` and `BZip2Decompressor` provide asynchronous bzip2 support through direction-
specific `compress-utils` imports. The encoder or decoder is loaded only when that operation runs.
```typescript
import {BZip2Compressor, BZip2Decompressor} from '@loaders.gl/compression';
```
Both implement the shared [Compressor and Decompressor](./compressor-decompressor) APIs, including
incremental batch methods. Install the optional `compress-utils` peer dependency.
## Backend choice
The currently supported backend is `compress-utils`, available directly as
`bzip2-compressor-compress-utils` and `bzip2-decompressor-compress-utils`. Direct backend imports
are mainly useful for explicit dependency policies and benchmarks.
See the [live benchmarks](/docs/modules/compression/benchmarks) for measured size and throughput.