Created
October 1, 2013 19:17
-
-
Save mikebroberts/6783619 to your computer and use it in GitHub Desktop.
Clojure spit always uses a Writer, so is no good for binary content. This spits to a stream so does work for binary.
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
(defn spit-to-stream [f content] | |
(with-open [w (clojure.java.io/output-stream f)] | |
(.write w content))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment