small-bytearray-builder-0.2.0.0: Serialize to a small byte arrays

Safe HaskellNone
LanguageHaskell2010

Data.ByteArray.Builder.Unsafe

Contents

Synopsis

Types

newtype Builder Source #

An unmaterialized sequence of bytes that may be pasted into a mutable byte array.

Constructors

Builder (forall s. MutableByteArray# s -> Int# -> Int# -> State# s -> (#State# s, Int##)) 

Safe Functions

These functions are actually completely safe, but they are defined here because they are used by typeclass instances. Import them from Data.ByteArray.Builder instead.

stringUtf8 :: String -> Builder Source #

Create a builder from a cons-list of Char. These are be UTF-8 encoded.

cstring :: CString -> Builder Source #

Create a builder from a NUL-terminated CString. This ignores any textual encoding, copying bytes until NUL is reached.