hs-zstd-0.1.1.1: Haskell bindings to the Zstandard compression algorithm

Copyright(c) 2016-present Facebook Inc. All rights reserved.
LicenseBSD3
Maintainerbryano@fb.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Codec.Compression.Zstd.Streaming

Description

Streaming compression and decompression support for zstd.

Synopsis

Documentation

data Result Source #

The result of a streaming compression or decompression step.

Constructors

Produce ByteString (IO Result)

A single frame of transformed data, and an action that when executed will yield the next step in the streaming operation. The action is ephemeral; you should discard it as soon as you use it.

Consume (ByteString -> IO Result)

Provide the function with more input for the streaming operation to continue. This function is ephemeral. You should call it exactly once, and discard it immediately after you call it.

To signal the end of a stream of data, supply an empty input.

Error String String

An error has occurred. If an error occurs, the streaming operation cannot continue.

Done ByteString

The streaming operation has ended. This payload may be empty. If it is not, it must be written out.

A non-empty payload consists of a frame epilogue, possibly preceded by any data left over from the final streaming step.

Instances
Show Result Source # 
Instance details

Defined in Codec.Compression.Zstd.Streaming

compress Source #

Arguments

:: Int

Compression level. Must be >= 1 and <= maxCLevel.

-> IO Result 

Begin a streaming compression operation.

The initial result will be either an Error or a Consume.

decompress :: IO Result Source #

Begin a streaming decompression operation.

The initial result will be either an Error or a Consume.

maxCLevel :: Int Source #

The maximum compression level supported by the library.