bzip2
bzip2-input-port
bzip2-output-port
7.1

bzip2

 (require file/bzip2) package: bzip2

The file/bzip2 module provides support for compressing and decompressing data using the bzip2 file format.

procedure

(bzip2-input-port in)  input-port?

  in : input-port?
Returns an input port that reads and decompresses bzip2 data from in.

procedure

(bzip2-output-port out    
  [#:block-size block-size])  output-port?
  out : output-port?
  block-size : (integer-in 1 9) = 9
Returns an output port that bzip2-compresses the data written to it, and writes the compressed data to out. The returned output port must be closed to ensure that all compressed data is written to the underlying port.

The optional block-size parameter controls size of the internal buffer used for compression. In general, the larger the block size, the better the compression — but also the higher the memory use. To reduce memory use, choose a lower value for block-size.