record StreamingCompressor : Type An initialized incremental compression stream.
Values of this type are valid only for the duration of
`withStreamingCompressor`.
Totality: total
Visibility: export
Constructor: MkStreamingCompressor : Compressor -> StreamingCompressor
Projection: .compressor : StreamingCompressor -> Compressor
record StreamingDecompressor : Type An initialized incremental decompression stream.
Values of this type are valid only for the duration of
`withStreamingDecompressor`.
Totality: total
Visibility: export
Constructor: MkStreamingDecompressor : Decompressor -> StreamingDecompressor
Projection: .decompressor : StreamingDecompressor -> Decompressor
withStreamingCompressor : ZlibCompressionLevel -> Wrapper -> (StreamingCompressor -> IO (Either (List ZlibError) a)) -> IO (Either (List ZlibError) a) Run an action with an initialized streaming compressor.
The underlying zlib stream is finalized and freed when the action returns.
Totality: total
Visibility: exportwithStreamingDecompressor : Wrapper -> (StreamingDecompressor -> IO (Either (List ZlibError) a)) -> IO (Either (List ZlibError) a) Run an action with an initialized streaming decompressor.
The underlying zlib stream is finalized and freed when the action returns.
Totality: total
Visibility: exportcompressChunk : StreamingCompressor -> IBuffer n -> IO (Either (List ZlibError) CompressStreamResult) Feed a chunk of uncompressed data into an incremental compressor.
The input is compressed using `Z_NO_FLUSH`, allowing zlib to preserve
compression effectiveness across chunk boundaries.
Zero or more compressed output chunks may be returned.
Totality: total
Visibility: exportcompressChunkWith : FlushMode -> StreamingCompressor -> IBuffer n -> IO (Either (List ZlibError) CompressStreamResult) Feed input into an incremental compressor using an explicit flush mode.
Frequent flushing can reduce compression effectiveness. `NoFlush` should
normally be used for ordinary input chunks.
Totality: total
Visibility: exportfinishCompressor : StreamingCompressor -> IO (Either (List ZlibError) CompressStreamResult) Finish an incremental compression stream and return all remaining output.
After this function successfully returns `finished = True`, the compressor
must not be used again unless its underlying zlib state is reset.
Totality: total
Visibility: exportdecompressChunk : StreamingDecompressor -> IBuffer n -> IO (Either (List ZlibError) DecompressStreamResult) Feed a compressed input chunk into an incremental decompressor.
The function processes as much input as possible and returns zero or more
decompressed output chunks.
`consumed` indicates exactly how many bytes from the supplied input were
consumed. If `finished` is true and `consumed` is smaller than the input
size, the remaining bytes follow the compressed stream and are left for
the caller.
Totality: total
Visibility: export