livery_codec_gzip (livery v0.2.0)

View Source

Built-in gzip content-coding over OTP zlib.

Emits RFC 1952 gzip framing (zlib WindowBits 31): one valid gzip member with the header written once and the CRC/ISIZE trailer at finish, so the streamed output decodes in any conformant client.

Summary

Functions

One-shot gzip of a whole body.

Content-Encoding token.

Release the streaming context.

Trailing bytes finalizing the gzip member.

Open a streaming gzip context.

Compress and flush one chunk.

Functions

compress(Data)

-spec compress(iodata()) -> iodata().

One-shot gzip of a whole body.

name()

-spec name() -> binary().

Content-Encoding token.

stream_close(Z)

-spec stream_close(zlib:zstream()) -> ok.

Release the streaming context.

stream_finish(Z)

-spec stream_finish(zlib:zstream()) -> iodata().

Trailing bytes finalizing the gzip member.

stream_init()

-spec stream_init() -> zlib:zstream().

Open a streaming gzip context.

stream_update(Z, Data)

-spec stream_update(zlib:zstream(), iodata()) -> iodata().

Compress and flush one chunk.