Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
lzlib
operations in the ST
monad
See respective functions in Codec.Compression.Lzlib for documentation where missing.
Synopsis
- data LzEncoder s
- data CompressParams = CompressParams {}
- compressParamPreset :: Int -> CompressParams
- lzCompressOpen :: CompressParams -> ST s (Either LzErrno (LzEncoder s))
- lzCompressClose :: LzEncoder s -> ST s ()
- lzCompressRead :: LzEncoder s -> Int -> ST s ByteString
- lzCompressWrite :: LzEncoder s -> ByteString -> ST s Int
- lzCompressSyncFlush :: LzEncoder s -> ST s LzErrno
- lzCompressFinish :: LzEncoder s -> ST s LzErrno
- lzCompressFinished :: LzEncoder s -> ST s Bool
- lzCompressMemberFinished :: LzEncoder s -> ST s Bool
- lzCompressRestartMember :: LzEncoder s -> Word64 -> ST s LzErrno
- data LzDecoder s
- lzDecompressOpen :: ST s (Either LzErrno (LzDecoder s))
- lzDecompressClose :: LzDecoder s -> ST s ()
- lzDecompressRead :: LzDecoder s -> Int -> ST s ByteString
- lzDecompressWrite :: LzDecoder s -> ByteString -> ST s Int
- lzDecompressSyncToMember :: LzDecoder s -> ST s LzErrno
- lzDecompressFinish :: LzDecoder s -> ST s LzErrno
- lzDecompressFinished :: LzDecoder s -> ST s Bool
- lzDecompressMemberFinished :: LzDecoder s -> ST s Bool
- lzDecompressReset :: LzDecoder s -> ST s LzErrno
- data LzErrno
Compression functions
data CompressParams Source #
Parameters for lzip
compressor
If compressDictionarySize
is 65535 and compressMatchLenLimit
is 16, the "fast variant" of LZMA is chosen.
CompressParams | |
|
compressParamPreset :: Int -> CompressParams Source #
Construct CompressParams
based on the standard preset levels used by the lzip
command-line interface.
The table below shows the parameters as a function of the level input argument:
level | compressDictionarySize | compressMatchLenLimit |
---|---|---|
≤0 | 65535 bytes | 16 bytes |
1 | 1 MiB | 5 bytes |
2 | 1.5 MiB | 6 bytes |
3 | 2 MiB | 8 bytes |
4 | 3 MiB | 12 bytes |
5 | 4 MiB | 20 bytes |
6 | 8 MiB | 36 bytes |
7 | 16 MiB | 68 bytes |
8 | 24 MiB | 132 bytes |
≥9 | 32 MiB | 273 bytes |
compressMemberSize
is set to its maximum allowed value (i.e. 2 PiB) for all compression levels.
NOTE: The "0" preset parameters will cause the encoder to use the "fast variant" of the LZMA algorithm.
lzCompressOpen :: CompressParams -> ST s (Either LzErrno (LzEncoder s)) Source #
lzCompressClose :: LzEncoder s -> ST s () Source #
lzCompressRead :: LzEncoder s -> Int -> ST s ByteString Source #
lzCompressWrite :: LzEncoder s -> ByteString -> ST s Int Source #
Decompression functions
lzDecompressClose :: LzDecoder s -> ST s () Source #
lzDecompressRead :: LzDecoder s -> Int -> ST s ByteString Source #
lzDecompressWrite :: LzDecoder s -> ByteString -> ST s Int Source #
Error codes
lzlib
error codes
See lzlib manual for more details.
LzOk | |
LzBadArgument | |
LzMemError | |
LzSequenceError | |
LzHeaderError | |
LzUnexpectedEof | |
LzDataError | |
LzLibraryError | |
LzUnknown | not defined by |
Instances
Eq LzErrno Source # | |
Show LzErrno Source # | |
Exception LzErrno Source # | |
Defined in Codec.Compression.Lzlib.FFI toException :: LzErrno -> SomeException # fromException :: SomeException -> Maybe LzErrno # displayException :: LzErrno -> String # |