Skip to content

Instantly share code, notes, and snippets.

@michaelbarton
Created August 29, 2011 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelbarton/1177441 to your computer and use it in GitHub Desktop.
Save michaelbarton/1177441 to your computer and use it in GitHub Desktop.
(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