diff options
Diffstat (limited to 'LengthPrefixedBE.hs')
-rw-r--r-- | LengthPrefixedBE.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/LengthPrefixedBE.hs b/LengthPrefixedBE.hs index 9d8472d..dd74fe3 100644 --- a/LengthPrefixedBE.hs +++ b/LengthPrefixedBE.hs | |||
@@ -10,6 +10,7 @@ import Control.Monad (when) | |||
10 | import Data.Bits | 10 | import Data.Bits |
11 | import Data.Binary | 11 | import Data.Binary |
12 | import Data.Binary.Get | 12 | import Data.Binary.Get |
13 | import Data.Binary.Put (putWord32be, putLazyByteString) | ||
13 | import Data.Int | 14 | import Data.Int |
14 | 15 | ||
15 | {- | 16 | {- |
@@ -41,8 +42,8 @@ newtype LengthPrefixedBE = LengthPrefixedBE Integer | |||
41 | instance Binary LengthPrefixedBE where | 42 | instance Binary LengthPrefixedBE where |
42 | 43 | ||
43 | put (LengthPrefixedBE n) = do | 44 | put (LengthPrefixedBE n) = do |
44 | put len | 45 | putWord32be len |
45 | put bytes | 46 | putLazyByteString bytes |
46 | where | 47 | where |
47 | bytes = encode_bigendian n | 48 | bytes = encode_bigendian n |
48 | len = fromIntegral (L.length bytes) :: Word32 | 49 | len = fromIntegral (L.length bytes) :: Word32 |