Skip to content

Instantly share code, notes, and snippets.

@mikebroberts
Created October 1, 2013 19:17
Show Gist options
  • Save mikebroberts/6783619 to your computer and use it in GitHub Desktop.
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.
(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