Created
May 12, 2014 14:02
-
-
Save pingles/dc442a87ab70cfd0e996 to your computer and use it in GitHub Desktop.
write and consume bytes with baldr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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