Codec-Compression-LZF-0.2: LZF compression bindings.




compress :: Ptr a -> Int -> Ptr b -> Int -> IO IntSource

Compress a block of data. The length of data is not recorded. Returns the length of output or 0 if it is longer than the size of the output buffer.

decompress :: Ptr a -> Int -> Ptr b -> Int -> IO IntSource

Decompress a block of data. Returns the length of data uncompressed or 0 on error.

compressString :: String -> IO StringSource

Compress a string with worst case length = original + 1. The first char of the string contains the length of the original.

decompressString :: String -> IO StringSource

Decompress a string compressed with compressString.