   ;; opening bracket.
   (loop [i (.read stream), key nil, result (transient {})]
     (when (neg? i) (throw (EOFException. "JSON error (end-of-file inside array)")))
-    (let [c (char i)]
+    (let [c i]
       (cond
        (Character/isWhitespace c) (recur (.read stream) key result)
 
-       (= c \,) (recur (.read stream) nil result)
-
-       (= c \:) (recur (.read stream) key result)
-
-       (= c \}) (if (nil? key)
+       (= c (codepoint \,)) (recur (.read stream) nil result)
+
+       (= c (codepoint \:)) (recur (.read stream) key result)
+
+       (= c (codepoint \})) (if (nil? key)
                   (persistent! result)
                   (throw (Exception. "JSON error (key missing value in object)")))
 


;;; JSON READER

(declare read-json-reader)

(defn- read-json-array [^PushbackReader stream keywordize?]

(defn- read-json-escaped-character [^PushbackReader stream]
  ;; Expects to be called with the head of the stream AFTER the
  ;; initial backslash.
  (let [c (.read stream)]
    (cond
     (#{(codepoint \") (codepoint \\) (codepoint \/)} c) (char c)
     (= c (codepoint \b)) \backspace
     (= c (codepoint \f)) \formfeed
     (= c (codepoint \n)) \newline
     (= c (codepoint \r)) \return
     (= c (codepoint \t)) \tab
     (= c (codepoint \u)) (read-json-hex-character stream))))

(defn- read-json-quoted-string [^PushbackReader stream]
  ;; Expects to be called with the head of the stream AFTER the
