| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Codec.Compression.Snappy.Framed.Framing2
Description
The current version of the official format.
The name "framing2" refers to the format which was specified and then (backwards-compatibly) modified in the following revisions of the official snappy repo:
- framing format revision 2013-01-05, snappy 1.1.0, svn r71, git 27a0cc3
- framing format revision 2013-10-25, snappy 1.1.2, svn r82, git f82bff6
Example encoding of the string "foobar\n":
00000000 ff 06 00 00 73 4e 61 50 70 59 01 0b 00 00 0a 17 |....sNaPpY......| 00000010 bb 3a 66 6f 6f 62 61 72 0a |.:foobar.|
Reference: https://github.com/google/snappy/blob/f82bff6/framing_format.txt
- parseHeader :: Parser ()
- parseBlock :: Parser ByteString
Documentation
parseHeader :: Parser () Source
Attempt to parse the header. If the header exists, it will be consumed. If not, the parser will fail.
parseBlock :: Parser ByteString Source
Parse a single block of the compressed bytestream, returning a segment of the uncompressed stream.
TODO (asayers): defer to snappy-framing package, which implements this format.