   "Converts x to a JSON-formatted string. Options are the same as
   write."
   [x & options]
-  (let [sw (StringBuilder.)]
+  (let [sw (StringWriter.)]
     (-write x sw (merge default-write-options (apply array-map options)))
     (.toString sw)))
 


(defn- write-string [^CharSequence s ^Appendable out options]
  (let [decoder codepoint-decoder]
    (.append out (codepoint \"))
    (dotimes [i (.length s)]
      (let [cp (int (.charAt s i))]
        (if (< cp 128)
          (case (aget decoder cp)
            0 (.append out cp)
            1 (do (.append out (codepoint \\)) (.append out cp))
            2 (.append out (if (get options :escape-slash) "\\/" "/"))
            3 (.append out "\\b")
            4 (.append out "\\f")


;;; JSON READER

(set! *warn-on-reflection* true)

(defn- default-write-key-fn
  [x]
