Created
August 29, 2011 00:14
-
-
Save michaelbarton/1177441 to your computer and use it in GitHub Desktop.
This file contains 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
(ns download | |
(:require [clojure.contrib.io :as io]) | |
(:import [java.io File FileOutputStream])) | |
(defn download-binary [to from] | |
(with-open [out (FileOutputStream. to)] | |
(.write out | |
(io/to-byte-array | |
(io/input-stream | |
(io/as-url from)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment