@@ -5,6 +5,7 @@ module BitsPut
7 , putWord16be
7 , putWord16be
@@ -62,6 +63,17 @@ putWord16be n w
62 t' = fromIntegral (w `shiftL` (8-o'))
63 t' = fromIntegral (w `shiftL` (8-o'))
63 in (S (b `mappend` B.singleton w' `mappend` B.singleton w'') t' o')
64 in (S (b `mappend` B.singleton w' `mappend` B.singleton w'') t' o')
66+putWord32be :: Int -> Word32 -> BitPut ()
68+ | n <= 16 = putWord16be n (fromIntegral w)
70+ putWord32be (n-16) (w`shiftR`16)
71+ putWord32be 16 (w .&. 0x0000ffff)
73+putWord64be :: Int -> Word64 -> BitPut ()
75+ | n <= 16 = putWord16be n (fromIntegral w)
65flush :: S -> S
77flush :: S -> S
66flush s@(S b w o)
78flush s@(S b w o)
67 | o > 8 = error "flush: offset > 8"
79 | o > 8 = error "flush: offset > 8"