Advertisement
Guest User

Untitled

a guest
Jul 8th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn read-input-stream [is]
  2.   (let [bufsize 8196
  3.         buf (byte-array bufsize)]
  4.     (loop [out ""]
  5.       (let [n (.read is buf)]
  6.         (if (pos? n)
  7.           (do
  8.             (println "Read" n " bytes")
  9.             (recur (string/join out (apply str (take n (seq buf))))))
  10.           out)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement