https://github.com/uswitch/baldr-old-dead
Pure and light binary records
https://github.com/uswitch/baldr-old-dead
Last synced: 11 months ago
JSON representation
Pure and light binary records
- Host: GitHub
- URL: https://github.com/uswitch/baldr-old-dead
- Owner: uswitch
- License: epl-1.0
- Created: 2014-05-07T10:50:44.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-20T10:02:49.000Z (about 12 years ago)
- Last Synced: 2024-04-14T11:59:45.971Z (about 2 years ago)
- Language: Clojure
- Size: 164 KB
- Stars: 23
- Watchers: 47
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# 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`.
```clojure
(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`.
```clojure
(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.