-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Compression and decompression in the gzip and zlib formats -- -- Compression and decompression in the gzip and zlib formats @package zlib @version 0.4 -- | Pure stream based interface to lower level zlib wrapper module Codec.Compression.Zlib.Internal compressDefault :: Format -> CompressionLevel -> ByteString -> ByteString decompressDefault :: Format -> ByteString -> ByteString data Format -- | Encode or decode with the gzip header format. GZip :: Format -- | Encode or decode with the zlib header format. Zlib :: Format -- | Encode or decode a raw data stream without any header. Raw :: Format -- | Enable zlib or gzip decoding with automatic header detection. This -- only makes sense for decompression. GZipOrZlib :: Format -- | Control amount of compression. This is a trade-off between the amount -- of compression and the time and memory required to do the compression. data CompressionLevel -- | The default compression level is 6 (that is, biased towards high -- compression at expense of speed). DefaultCompression :: CompressionLevel -- | No compression, just a block copy. NoCompression :: CompressionLevel -- | The fastest compression method (less compression) BestSpeed :: CompressionLevel -- | The slowest compression method (best compression). BestCompression :: CompressionLevel -- | A specific compression level between 1 and 9. CompressionLevel :: Int -> CompressionLevel compressFull :: Format -> CompressionLevel -> Method -> WindowBits -> MemoryLevel -> CompressionStrategy -> ByteString -> ByteString decompressFull :: Format -> WindowBits -> ByteString -> ByteString -- | The compression method data Method -- | 'Deflate' is the only one supported in this version of zlib. Deflated :: Method data WindowBits DefaultWindowBits :: WindowBits WindowBits :: Int -> WindowBits -- | The MemoryLevel parameter specifies how much memory should be -- allocated for the internal compression state. data MemoryLevel -- | The default. (Equivalent to MemoryLevel 8) DefaultMemoryLevel :: MemoryLevel -- | Use minimum memory. This is slow and reduces the compression ratio. -- (Equivalent to MemoryLevel 1) MinMemoryLevel :: MemoryLevel -- | Use maximum memory for optimal compression speed. (Equivalent to -- MemoryLevel 9) MaxMemoryLevel :: MemoryLevel -- | Use a specific level in the range 1..9 MemoryLevel :: Int -> MemoryLevel -- | The strategy parameter is used to tune the compression algorithm. -- -- The strategy parameter only affects the compression ratio but not the -- correctness of the compressed output even if it is not set -- appropriately. data CompressionStrategy -- | Use the DefaultStrategy for normal data. DefaultStrategy :: CompressionStrategy -- | Use Filtered for data produced by a filter (or predictor). -- Filtered data consists mostly of small values with a somewhat random -- distribution. In this case, the compression algorithm is tuned to -- compress them better. The effect of Z_FILTERED is to force more -- Huffman coding and less string matching; it is somewhat intermediate -- between DefaultStrategy and HuffmanOnly. Filtered :: CompressionStrategy -- | Use HuffmanOnly to force Huffman encoding only (no string -- match). HuffmanOnly :: CompressionStrategy -- | Compression and decompression of data streams in the raw deflate -- format. -- -- The format is described in detail in RFC #1951: -- http://www.ietf.org/rfc/rfc1951.txt -- -- See also the zlib home page: http://zlib.net/ module Codec.Compression.Zlib.Raw compress :: ByteString -> ByteString compressWith :: CompressionLevel -> ByteString -> ByteString -- | Control amount of compression. This is a trade-off between the amount -- of compression and the time and memory required to do the compression. data CompressionLevel -- | The default compression level is 6 (that is, biased towards high -- compression at expense of speed). DefaultCompression :: CompressionLevel -- | No compression, just a block copy. NoCompression :: CompressionLevel -- | The fastest compression method (less compression) BestSpeed :: CompressionLevel -- | The slowest compression method (best compression). BestCompression :: CompressionLevel -- | A specific compression level between 1 and 9. CompressionLevel :: Int -> CompressionLevel decompress :: ByteString -> ByteString -- | Compression and decompression of data streams in the zlib format. -- -- The format is described in detail in RFC #1950: -- http://www.ietf.org/rfc/rfc1950.txt -- -- See also the zlib home page: http://zlib.net/ module Codec.Compression.Zlib compress :: ByteString -> ByteString compressWith :: CompressionLevel -> ByteString -> ByteString -- | Control amount of compression. This is a trade-off between the amount -- of compression and the time and memory required to do the compression. data CompressionLevel -- | The default compression level is 6 (that is, biased towards high -- compression at expense of speed). DefaultCompression :: CompressionLevel -- | No compression, just a block copy. NoCompression :: CompressionLevel -- | The fastest compression method (less compression) BestSpeed :: CompressionLevel -- | The slowest compression method (best compression). BestCompression :: CompressionLevel -- | A specific compression level between 1 and 9. CompressionLevel :: Int -> CompressionLevel decompress :: ByteString -> ByteString -- | Compression and decompression of data streams in the gzip format. -- -- The format is described in detail in RFC #1952: -- http://www.ietf.org/rfc/rfc1952.txt -- -- See also the zlib home page: http://zlib.net/ module Codec.Compression.GZip -- | Compress a stream of data into the gzip format. -- -- This uses the default compression level which favours a higher -- compression ratio over compression speed. Use compressWith to -- adjust the compression level. compress :: ByteString -> ByteString -- | Like compress but with an extra parameter to specify the -- compression level. -- -- There are a number of additional compression parameters which are -- rarely necessary to change but if you need to you can do so using -- compressFull. compressWith :: CompressionLevel -> ByteString -> ByteString -- | Control amount of compression. This is a trade-off between the amount -- of compression and the time and memory required to do the compression. data CompressionLevel -- | The default compression level is 6 (that is, biased towards high -- compression at expense of speed). DefaultCompression :: CompressionLevel -- | No compression, just a block copy. NoCompression :: CompressionLevel -- | The fastest compression method (less compression) BestSpeed :: CompressionLevel -- | The slowest compression method (best compression). BestCompression :: CompressionLevel -- | A specific compression level between 1 and 9. CompressionLevel :: Int -> CompressionLevel -- | Decompress a stream of data in the gzip format. -- -- There are a number of errors that can occur. In each case an exception -- will be thrown. The possible error conditions are: -- -- -- -- Note that the decompression is performed lazily. Errors in the -- data stream may not be detected until the end of the stream is -- demanded (since it is only at the end that the final checksum can be -- checked). If this is important to you, you must make sure to consume -- the whole decompressed stream before doing any IO action that depends -- on it. decompress :: ByteString -> ByteString