livery_codec_deflate (livery v0.2.0)

View Source

Built-in deflate content-coding over OTP zlib.

Emits zlib-wrapped DEFLATE (RFC 1950, WindowBits 15), which is the spec-correct deflate content-coding (NOT raw DEFLATE). Decodes with zlib:uncompress/1 and any conformant client.

Summary

Functions

One-shot zlib-wrapped DEFLATE of a whole body.

Content-Encoding token.

Release the streaming context.

Trailing bytes finalizing the deflate stream.

Open a streaming deflate context.

Compress and flush one chunk.

Functions

compress(Data)

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

One-shot zlib-wrapped DEFLATE 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 deflate stream.

stream_init()

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

Open a streaming deflate context.

stream_update(Z, Data)

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

Compress and flush one chunk.