livery_codec_zlib (livery v0.2.0)
View SourceShared OTP zlib streaming backend for the gzip and deflate codecs.
The two built-in codecs differ only in the zlib WindowBits value
(31 for gzip framing, 15 for zlib-wrapped DEFLATE), so the streaming
machinery lives here once. stream_update/2 uses a sync flush so each
producer chunk is emittable immediately.
Summary
Functions
Release the stream. Frees the underlying zlib resource.
Return the trailing bytes that finalize the stream.
Open a deflate stream with the given zlib WindowBits.
Compress a chunk and flush, returning the bytes emittable now.
Functions
-spec stream_close(zlib:zstream()) -> ok.
Release the stream. Frees the underlying zlib resource.
-spec stream_finish(zlib:zstream()) -> iodata().
Return the trailing bytes that finalize the stream.
-spec stream_init(integer()) -> zlib:zstream().
Open a deflate stream with the given zlib WindowBits.
-spec stream_update(zlib:zstream(), iodata()) -> iodata().
Compress a chunk and flush, returning the bytes emittable now.