Modulesnappy-framing-0.1.2Haskell2010
Codec.Compression.Snappy.Framing
- 3 types
- 11 values
- Packagesnappy-framing-0.1.2
- Exports14
- LanguageHaskell2010
- LicenceMPL-2.0
- SourceFraming.hs
Exported Types
3 declarationsEncoding and Decoding
8 declarationsEncode a lazy ByteString into a Chunk
If the input is longer than minCompressible bytes, the resulting chunk is
Compressed otherwise Uncompressed. If the input size exceeds
maxUncompressed bytes, the leftover input is returned in a Just.
Encode a strict ByteString into a Chunk
If the input is longer than minCompressible bytes, the resulting chunk is
Compressed otherwise Uncompressed. If the input size exceeds
maxUncompressed bytes, the leftover input is returned in a Just.
Decode a lazy ByteString into a Chunk
Decode a strict ByteString into a Chunk
Decode a lazy ByteString into a Chunk and verify the result
Decode a strict ByteString into a Chunk and verify the result
decodeM :: Monad m=> m (Maybe ByteString)And action that will be run to provide input. If it returns Nothing it is assumed no more input is available.
-> m (Either DecodeError Chunk, Maybe ByteString)Either a parse error or a Chunk, along with leftovers if any.
Decode drawing input from the given monadic action as needed
Utility functions
3 declarationsCompute a masked CRC32C checksum of the input
Yield a stream identifier (start-of-stream marker)
Verify a Chunk
Returns Nothing if the input is an Unskippable chunk, or the checksum verification fails (if the input is a Compressed or Uncompressed chunk). Otherwise, the input Chunk is returned in a Just. Note that Compressed chunks are decompressed into Uncompressed chunks on the fly.