Skip to content

Instantly share code, notes, and snippets.

@pingles
Created May 12, 2014 14:02
Show Gist options
  • Save pingles/dc442a87ab70cfd0e996 to your computer and use it in GitHub Desktop.
Save pingles/dc442a87ab70cfd0e996 to your computer and use it in GitHub Desktop.
write and consume bytes with baldr
(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)
;; now we can create a baldr-seq over the input stream
;; containing our 2 previously written records
(baldr.core/baldr-seq (ByteArrayInputStream. (.toByteArray ostream))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment