diff --git a/project.clj b/project.clj index 7c22550..b29c190 100644 --- a/project.clj +++ b/project.clj @@ -3,9 +3,10 @@ :url "https://github.com/ptaoussanis/nippy" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :dependencies [[org.clojure/clojure "1.4.0"] - [expectations "1.4.49"] - [org.iq80.snappy/snappy "0.3"]] + :dependencies [[org.clojure/clojure "1.4.0"] + [org.clojure/tools.reader "0.7.5"] + [expectations "1.4.49"] + [org.iq80.snappy/snappy "0.3"]] :profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} :1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]} diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index 9a6a541..a1f4262 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -5,7 +5,9 @@ (:require [taoensso.nippy (utils :as utils) (compression :as compression :refer (snappy-compressor)) - (encryption :as encryption :refer (aes128-encryptor))]) + (encryption :as encryption :refer (aes128-encryptor))] + [clojure.tools.reader + (edn :as edn)]) (:import [java.io DataInputStream DataOutputStream ByteArrayOutputStream ByteArrayInputStream] [clojure.lang Keyword BigInt Ratio PersistentQueue PersistentTreeMap @@ -227,7 +229,7 @@ (let [type-id (.readByte s)] (utils/case-eval type-id - id-reader (read-string (read-utf8 s)) + id-reader (edn/read-string (read-utf8 s)) id-bytes (read-bytes s) id-nil nil id-boolean (.readBoolean s) @@ -262,7 +264,7 @@ (bigint (read-biginteger s))) ;;; DEPRECATED - id-old-reader (read-string (.readUTF s)) + id-old-reader (edn/read-string (.readUTF s)) id-old-string (.readUTF s) id-old-map (apply hash-map (utils/repeatedly-into [] (* 2 (.readInt s)) (thaw-from-stream s)))