bytestring-tree-builder-0.2.5: A very efficient ByteString builder implementation based on the binary tree

Safe HaskellNone
LanguageHaskell2010

ByteString.TreeBuilder

Contents

Synopsis

Documentation

data Builder Source

A binary-tree-based datastructure optimized for aggregation of bytestrings using the O(1) appending operation.

Instances

Declaration

Primitives

byteString :: ByteString -> Builder Source

Lifts a bytestring into the builder.

byte :: Word8 -> Builder Source

Lifts a single byte into the builder.

Extras

Execution

length :: Builder -> Int Source

O(1). Gets the total length.

toByteString :: Builder -> ByteString Source

O(n). Converts the builder into a strict bytestring.

toLazyByteString :: Builder -> ByteString Source

O(n). Converts the builder into a lazy bytestring.