summaryrefslogtreecommitdiff
path: root/LengthPrefixedBE.hs
diff options
context:
space:
mode:
Diffstat (limited to 'LengthPrefixedBE.hs')
-rw-r--r--LengthPrefixedBE.hs5
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)
10import Data.Bits 10import Data.Bits
11import Data.Binary 11import Data.Binary
12import Data.Binary.Get 12import Data.Binary.Get
13import Data.Binary.Put (putWord32be, putLazyByteString)
13import Data.Int 14import Data.Int
14 15
15{- 16{-
@@ -41,8 +42,8 @@ newtype LengthPrefixedBE = LengthPrefixedBE Integer
41instance Binary LengthPrefixedBE where 42instance 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