     "Print object to PrintWriter out as JSON"))
 
 (defn- write-string [^CharSequence s ^PrintWriter out]
-  (let [sb (StringBuilder. (count s))]
+  (let [sb (StringBuilder. (.length s))]
     (.append sb \")
-    (dotimes [i (count s)]
+    (dotimes [i (.length s)]
       (let [cp (int (.charAt s i))]
         (codepoint-case cp
           ;; Printable JSON escapes

(defn- read-quoted-string [^PushbackReader stream]
  ;; Expects to be called with the head of the stream AFTER the
  ;; opening quotation mark.
  (let [buffer (StringBuilder.)]
    (loop []
      (let [c (.read stream)]
        (when (neg? c)

    (Double/valueOf string)))

(defn- read-number [^PushbackReader stream]
  (let [buffer (StringBuilder. 4)
        decimal? (loop [decimal? false]
                   (let [c (.read stream)]
                     (codepoint-case c
