small-bytearray-builder

Serialize to a small byte arrays https://github.com/andrewthad/small-bytearray-builder

Version on this page:0.2.1.0
Stackage Nightly 2019-12-11:0.2.1.0
Latest on Hackage:0.3.1.0

See all snapshots small-bytearray-builder appears in

BSD-3-Clause licensed by Andrew Martin

Module documentation for 0.2.1.0

This version can be pinned in stack with:small-bytearray-builder-0.2.1.0@sha256:b534aa72119567ea4e3662c90325e202ad2688242c7403d5808847116a99244f,2721

This is similar to the builder facilities provided by Data.ByteString.Builder. It is intended to be used in situations where the following apply:

  • An individual entity will be serialized as a small number of bytes (less than 512).

  • A large number (more than 32) of entities will be serialized one after another without anything between them.

Unlike builders from the bytestring package, these builders do not track their state when they run out of space. A builder that runs out of space simply aborts and is rerun at the beginning of the next chunk. This strategy for building is suitable for most CSVs and several line protocols (carbon, InfluxDB, etc.).

Changes

Revision history for small-bytearray-builder

0.2.1.0 – 2019-09-05

  • Stop exporting data constructor in Data.ByteArray.Builder. This is technically a breaking change, but it was only exported by accident. So, with this release, we will technically violate PVP, and the previous release will be deprecated on hackage.
  • Add more functions for encoding unsigned words: word16PaddedLowerHex, word16LowerHex, word16UpperHex, word8LowerHex.
  • Unroll loop for word8Dec.

0.2.0.0 – 2019-09-04

  • Use natural-arithmetic to make manipulation of bounds possible.
  • Add more functions for encoding numbers. This includes word8/16/32/64 and int8/16/32/64.
  • Rename the modules.
  • Correct a serious error in the implementation of bytes.
  • Make pasteGrowST accept an initial offset.
  • Add a pasteGrowST for length-indexed builders.
  • Add function for rendering floating-point numbers in a slightly inaccurate way.
  • Add functions for encoding ShortText as UTF-8 and as a JSON string.

0.1.1.0 – 2019-07-30

  • Add several additional functions for encoding numbers.

0.1.0.0 – 2019-06-25

  • First version
comments powered byDisqus