compressWith : ZlibCompressionLevel -> Wrapper -> IBuffer n -> IO (Either (List ZlibError) AnyBuffer) Compress an immutable byte buffer using the requested compression level
and wrapper format.
The compressor is acquired and released using `withCompressor`, ensuring
that the underlying zlib stream is finalized and freed even if compression
fails.
The output buffer is allocated once using `deflateBound`, which computes
sufficient capacity for compressing the complete input with `Finish`.
Compression therefore requires a single call to `deflateBuffer`.
Input and output bytes are passed to zlib without intermediate copies.
On the Chez backend, their underlying bytevectors are borrowed directly by
the C shim for the duration of the foreign call.
The returned `AnyBuffer` contains exactly the number of bytes produced by
zlib, although its underlying allocation may be larger because the used
prefix is wrapped without copying.
Inputs too large to be represented by zlib's one-shot `avail_in` /
`avail_out` interface are rejected. Large-input support is provided by the
incremental compression API rather than by this one-shot operation.
Totality: total
Visibility: exportcompress : IBuffer n -> IO (Either (List ZlibError) AnyBuffer) Compress an immutable byte buffer using the standard zlib wrapper and
zlib's default compression level.
Totality: total
Visibility: exportgzipCompress : IBuffer n -> IO (Either (List ZlibError) AnyBuffer) Compress an immutable byte buffer using the gzip wrapper and zlib's
default compression level.
Totality: total
Visibility: exportrawCompress : IBuffer n -> IO (Either (List ZlibError) AnyBuffer) Compress an immutable byte buffer as a raw DEFLATE stream with no zlib or
gzip wrapper, using zlib's default compression level.
Totality: total
Visibility: export