@@ -268,8 +268,8 @@ extract bo bs o n
268 rev = case bo of
268 rev = case bo of
269 LL -> reverseBits n
269 LL -> reverseBits n
270 BL -> reverseBits n
270 BL -> reverseBits n
271− BB -> id
271+ BB -> id
272− LB -> id
272+ LB -> id
275-- | Generic readWord
275-- | Generic readWord
@@ -296,15 +296,15 @@ readWordChecked m n s
296-- | Read the given number of bytes and return them in Big-Endian order
296-- | Read the given number of bytes and return them in Big-Endian order
298-- Examples:
298-- Examples:
299−-- BB: xxxABCDE FGHIJKLM NOPQRxxx -> ABCDEFGH IJKLMNOP QRxxxxxx
299+-- BB: xxxABCDE FGHIJKLM NOPxxxxx -> ABCDEFGH IJKLMNOP
300−-- LB: NOPQRxxx FGHIJKLM xxxABCDE -> ABCDEFGH IJKLMNOP QRxxxxxx
300+-- LB: LMNOPxxx DEFGHIJK xxxxxABC -> ABCDEFGH IJKLMNOP
301−-- BL: xxxRQPON MLKJIHGF EDCBAxxx -> ABCDEFGH IJKLMNOP QRxxxxxx
301+-- BL: xxxPONML KJIHGFED CBAxxxxx -> ABCDEFGH IJKLMNOP
302−-- LL: EDCBAxxx MLKJIHGF xxxRQPON -> ABCDEFGH IJKLMNOP QRxxxxxx
302+-- LL: EDCBAxxx MLKJIHGF xxxxxPON -> ABCDEFGH IJKLMNOP
303readByteString :: Int -> S -> ByteString
303readByteString :: Int -> S -> ByteString
304readByteString n (S bs o bo) =
304readByteString n (S bs o bo) =
306 bs' = unsafeTake (n+1) bs
306 bs' = unsafeTake (n+1) bs
307− rev = B.map (reverseBits 9)
307+ rev = B.map (reverseBits 8)
308 in case (o,bo) of
308 in case (o,bo) of
309 (0,BB) -> unsafeTake n bs
309 (0,BB) -> unsafeTake n bs
310 (0,LB) -> B.reverse (unsafeTake n bs)
310 (0,LB) -> B.reverse (unsafeTake n bs)