Hi,
I was wondering why there aren't versions of the copy method in
clojure.java.io that handle URLs as input. I have needed, written and
reused them several times now.
So I thought it would be a good idea to include them in
clojure.java.io.
Adding the following methods and updating the docstring for copy would
do the trick:
(defmethod do-copy [URL OutputStream] [^URL input ^OutputStream output
opts]
(with-open [in (-> input .openStream BufferedInputStream.)]
(do-copy in output opts)))
(defmethod do-copy [URL Writer] [^URL input ^Writer output opts]
(with-open [in (-> input .openStream BufferedInputStream.)]
(do-copy in output opts)))
(defmethod do-copy [URL File] [^URL input ^File output opts]
(with-open [in (-> input .openStream BufferedInputStream.)]
(do-copy in output opts)))
Thanks,
mrBliss
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en