Portability | portable |
---|---|
Stability | experimental |
Maintainer | Bryan O'Sullivan <bos@mailrank.com> |
This module provides fast, pure zero-copy compression and
decompression of lazy ByteString
data using the Snappy format.
Although these functions operate on lazy ByteString
s, they
consume the data strictly: they do not produce any output until
they have consumed all of the input, and they produce the output in
a single large chunk.
If your data is already in the form of a lazy ByteString
, it is
likely more efficient to use these functions than to convert your
data to and from strict ByteStrings, as you can avoid the
additional allocation and copying that would entail.
- compress :: ByteString -> ByteString
- decompress :: ByteString -> ByteString
Documentation
compress :: ByteString -> ByteStringSource
Compress data into the Snappy format.
decompress :: ByteString -> ByteStringSource
Decompress data in the Snappy format.
If the input is not compressed or is corrupt, an exception will be thrown.