read-chars

swank.util.io

  • (read-chars rdr n)
  • (read-chars rdr n throw-exception)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source swank/util/io.clj:6 top

(defn read-chars
  ([rdr n] (read-chars rdr n false))
  ([#^Reader rdr n throw-exception]
     (let [sb (StringBuilder.)]
       (dotimes [i n]
         (let [c (.read rdr)]
           (if (not= c -1)
             (.append sb (char c))
             (when throw-exception
               (throw throw-exception)))))
       (str sb))))
Vars in swank.util.io/read-chars: char defn dotimes let not= str when
Used in 0 other vars

Comments top

No comments for read-chars. Log in to add a comment.