Copyright | (c) Abhinav Gupta 2015 |
---|---|
License | BSD3 |
Maintainer | Abhinav Gupta <mail@abhinavg.net> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module implements a ByteString builder very similar to
Builder
except that it keeps track of its final serialized
length. This allows it to allocate the target ByteString in one malloc
and
simply write the bytes to it.
Documentation
runBuilder :: Builder -> ByteString Source
Build a ByteString from the given ByteString builder.
doubleBE :: Double -> Builder Source
Serialize a signed 64-bit floating point number in big endian format.
byteString :: ByteString -> Builder Source
Inlcude the given ByteString as-is in the builder.
Note that because this operation is applied lazily, we will maintain a reference to the ByteString until the builder is executed.