Home

Awesome

Yet another CL impementation of rfc1951 deflate decompression (optionally with rfc1950 zlib or rfc1952 gzip wrappers), with support for reading from foreign pointers (for use with mmap and similar, etc), and from CL octet vectors and streams.

Still somewhat WIP, but approaching usability.

Performance for vectors/pointers is somewhere between FFI to libz and chipz, still needs some low-level optimization of copy routines and checksums. Stream API is very slow, and may be replaced at some point.

API isn't completely stable yet, needs some actual use to figure out the details.

API/usage

easy API:

decompress-vector (compressed &key (format :zlib) output

;; pass a (simple-array (unsigned-byte 8) (*))
(3bz:decompress-vector (alexandria:read-file-into-byte-vector "foo.gz")
                       :format :gzip) ;; accepts :deflate, :zlib, :gzip
;; ->
#(....)
1234
;; get back decompressed data and size as 2 values

If decompressed size is known, you can save some copies by passing in a pre-allocated (simple-array (unsigned-byte 8) (*)) vector with :OUTPUT.

full API:

Allows input and output in multiple pieces, as well as input from vectors, FFI pointers, or streams (streams are currently very slow though).

performance notes: