Copyright | (c) Lennart Kolmodin 2010-2011 |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | kolmodin@gmail.com |
Stability | experimental |
Portability | portable (should run where the package binary runs) |
Safe Haskell | Safe |
Language | Haskell98 |
Data.Binary.Bits.Put
Contents
Description
Put bits easily.
Synopsis
- data BitPut a
- runBitPut :: BitPut () -> Put
- joinPut :: Put -> BitPut ()
- putBool :: Bool -> BitPut ()
- putWord8 :: Int -> Word8 -> BitPut ()
- putWord16be :: Int -> Word16 -> BitPut ()
- putWord32be :: Int -> Word32 -> BitPut ()
- putWord64be :: Int -> Word64 -> BitPut ()
- putByteString :: ByteString -> BitPut ()
Documentation
joinPut :: Put -> BitPut () Source #
Run a Put
inside BitPut
. Any partially written bytes will be flushed
before Put
executes to ensure byte alignment.
Data types
Bool
Words
putWord16be :: Int -> Word16 -> BitPut () Source #
Put the n
lower bits of a Word16
.
putWord32be :: Int -> Word32 -> BitPut () Source #
Put the n
lower bits of a Word32
.
putWord64be :: Int -> Word64 -> BitPut () Source #
Put the n
lower bits of a Word64
.
ByteString
putByteString :: ByteString -> BitPut () Source #
Put a ByteString
.