haskus-binary-1.5: Haskus binary format manipulation

Safe HaskellNone
LanguageHaskell2010

Haskus.Binary.BufferBuilder

Description

Buffer builder

Synopsis

Documentation

emptyBufferBuilder :: BufferBuilder Source #

Empty buffer builder

toBufferList :: BufferBuilder -> BufferList Source #

Execute a Builder and return the generated chunks as a BufferList. The work is performed lazily, i.e., only when a chunk of the BufferList is forced.

toBuffer :: BufferBuilder -> Buffer Source #

Execute a Builder and return the generated chunks as a Buffer.

fromBuffer :: Buffer -> BufferBuilder Source #

Create a Builder denoting the same sequence of bytes as a strict ByteString. The Builder inserts large ByteStrings directly, but copies small ones to ensure that the generated chunks are large on average.

fromWord8 :: Word8 -> BufferBuilder Source #

Encode a single unsigned byte as-is.