(defn ^String slurp*
"Like clojure.core/slurp but opens f with reader."
{:deprecated "1.2"}
[f]
(with-open [^BufferedReader r (reader f)]
(let [sb (StringBuilder.)]
(loop [c (.read r)]
(if (neg? c)
(str sb)
(do (.append sb (char c))
(recur (.read r))))))))
Comments top
No comments for slurp*. Log in to add a comment.