io-streams-1.5.2.2: Simple, composable, and easy-to-use stream I/O

Safe Haskell | None
Language | Haskell2010

System.IO.Streams.Zlib

Contents

- ByteString decompression
- ByteString compression
- Builder compression
- Compression level

Description

Interface to `zlib` and `gzip` compression for `Bytestring`s and `Builder`s

Synopsis

- gunzip :: InputStream ByteString -> IO (InputStream ByteString)
- decompress :: InputStream ByteString -> IO (InputStream ByteString)
- gzip :: CompressionLevel -> OutputStream ByteString -> IO (OutputStream ByteString)
- compress :: CompressionLevel -> OutputStream ByteString -> IO (OutputStream ByteString)
- gzipBuilder :: CompressionLevel -> OutputStream Builder -> IO (OutputStream Builder)
- compressBuilder :: CompressionLevel -> OutputStream Builder -> IO (OutputStream Builder)
- newtype CompressionLevel = CompressionLevel Int
- defaultCompressionLevel :: CompressionLevel

# ByteString decompression

gunzip :: InputStream ByteString -> IO (InputStream ByteString) #

Decompress an `InputStream` of strict `ByteString`s from the `gzip` format

decompress :: InputStream ByteString -> IO (InputStream ByteString) #

Decompress an `InputStream` of strict `ByteString`s from the `zlib` format

# ByteString compression

gzip :: CompressionLevel -> OutputStream ByteString -> IO (OutputStream ByteString) #

Convert an `OutputStream` that consumes compressed `ByteString`s into an `OutputStream` that consumes uncompressed `ByteString`s in the `gzip` format

compress :: CompressionLevel -> OutputStream ByteString -> IO (OutputStream ByteString) #

Convert an `OutputStream` that consumes compressed `ByteString`s into an `OutputStream` that consumes uncompressed `ByteString`s in the `zlib` format

# Builder compression

gzipBuilder :: CompressionLevel -> OutputStream Builder -> IO (OutputStream Builder) #

Convert an `OutputStream` that consumes compressed `Builder`s into an `OutputStream` that consumes uncompressed `Builder`s in the `gzip` format

compressBuilder :: CompressionLevel -> OutputStream Builder -> IO (OutputStream Builder) #

Convert an `OutputStream` that consumes compressed `Builder`s into an `OutputStream` that consumes uncompressed `Builder`s in the `zlib` format

# Compression level

newtype CompressionLevel #

Parameter that defines the tradeoff between speed and compression ratio

Constructors

CompressionLevel Int |

#### Instances

Instances details

Num CompressionLevel # |

Instance details

Defined in System.IO.Streams.Zlib

Methods

(+) :: CompressionLevel -> CompressionLevel -> CompressionLevel #

(-) :: CompressionLevel -> CompressionLevel -> CompressionLevel #

(*) :: CompressionLevel -> CompressionLevel -> CompressionLevel #

negate :: CompressionLevel -> CompressionLevel #

abs :: CompressionLevel -> CompressionLevel #

signum :: CompressionLevel -> CompressionLevel #

fromInteger :: Integer -> CompressionLevel #

Read CompressionLevel # |
Instance details Defined in System.IO.Streams.Zlib Methods readsPrec :: Int -> ReadS CompressionLevel # readList :: ReadS [CompressionLevel] # readPrec :: ReadPrec CompressionLevel # readListPrec :: ReadPrec [CompressionLevel] #
Show CompressionLevel # |
Instance details Defined in System.IO.Streams.Zlib Methods showsPrec :: Int -> CompressionLevel -> ShowS # show :: CompressionLevel -> String # showList :: [CompressionLevel] -> ShowS #
Eq CompressionLevel # |
Instance details Defined in System.IO.Streams.Zlib Methods (==) :: CompressionLevel -> CompressionLevel -> Bool # (/=) :: CompressionLevel -> CompressionLevel -> Bool #

defaultCompressionLevel :: CompressionLevel #

A compression level that balances speed with compression ratio