|
Data.Binary.Strict.BitGet | Stability | experimental | Maintainer | Adam Langley <agl@imperialviolet.org> |
|
|
|
|
|
Description |
This is a reader monad for parsing bit-aligned data. The usual Get monad
handles byte aligned data well.
In this monad, the current offset into the input is a number of bits, and
fetching n bits from the current position will shift everything correctly.
Bit vectors are represented as ByteStrings here either the first n bits
are valid (left aligned) or the last n bits are (right aligned).
If one is looking to parse integers etc, right alignment is the easist to
work with, however left alignment makes more sense in some situations.
|
|
Synopsis |
|
|
|
|
Get BitGet type
|
|
|
Instances | |
|
|
|
Run a BitGet on a ByteString
|
|
Utility
|
|
|
Skip n bits of the input. Fails if less then n bits remain
|
|
|
Return the number of bits remaining to be parsed
|
|
|
Return true if there are no more bits to parse
|
|
Generic parsing
|
|
|
Get a single bit from the input
|
|
|
Get a ByteString with the given number of bits, left aligned.
|
|
|
Get a ByteString with the given number of bits in, right aligned.
|
|
Interpreting some number of bits as an integer
|
|
|
|
|
Read a Word16 in big endian format
|
|
|
Read a Word32 in big endian format
|
|
|
Read a Word64 in big endian format
|
|
Parsing particular types
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.4.2 |