Pure and light binary records
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/baldr
test/baldr
.gitignore
LICENSE
README.md
project.clj

README.md

Baldr

baldr

Named after the "god of light and purity" in Norse mythology. A light and pure file format for records of bytes.

Usage

Add the library to your project dependencies.

[baldr "0.1.1"]

Write byte-arrays to an OutputStream using baldr-writer.

(let [ostream (ByteArrayOutputStream. 100)
      write (baldr.core/baldr-writer ostream)]
  (write (byte-array [1 2 3]))
  (write (byte-array [1 2 3 4]))
  (.close ostream))

Read seq of byte-arrays from an InputStream using baldr-seq.

(let [ostream (ByteArrayOutputStream. 100)
      write (baldr.core/baldr-writer ostream)]
  (write (byte-array [1 2 3]))
  (write (byte-array [1 2 3 4]))
  (.close ostream)
  (baldr.core/baldr-seq (ByteArrayInputStream. (.toByteArray ostream))))

License

Copyright © uSwitch

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.