diff --git a/project.clj b/project.clj index fd30d1d..2175f99 100644 --- a/project.clj +++ b/project.clj @@ -1,9 +1,9 @@ -(defproject com.taoensso/nippy "1.1.0-beta2" +(defproject com.taoensso/nippy "1.1.0-beta3" :description "Clojure serialization library" :url "https://github.com/ptaoussanis/nippy" :license {:name "Eclipse Public License"} :dependencies [[org.clojure/clojure "1.3.0"] - [org.iq80.snappy/snappy "0.2"]] + [org.iq80.snappy/snappy "0.3"]] :profiles {:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]} :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.5 {:dependencies [[org.clojure/clojure "1.5.0-alpha3"]]} diff --git a/src/taoensso/nippy/utils.clj b/src/taoensso/nippy/utils.clj index 7df1b64..30488e1 100644 --- a/src/taoensso/nippy/utils.clj +++ b/src/taoensso/nippy/utils.clj @@ -58,13 +58,5 @@ (try (>= (version-compare version-str min-version-str) 0) (catch Exception _ false))) -;; TODO Unnecessarily complicated. Waiting on http://goo.gl/7mbR3 merge. -(defn compress-bytes [ba] - (let [ba-size (alength ^bytes ba) - ba-out (byte-array (Snappy/maxCompressedLength ba-size)) - ba-out-size (Snappy/compress ba (int 0) (int ba-size) ba-out (int 0))] - (java.util.Arrays/copyOf ba-out ba-out-size))) - -(defn uncompress-bytes [ba] (Snappy/uncompress ba 0 (alength ^bytes ba))) - -(comment (String. (uncompress-bytes (compress-bytes (.getBytes "Test"))))) \ No newline at end of file +(defn compress-bytes [^bytes ba] (Snappy/compress ba)) +(defn uncompress-bytes [^bytes ba] (Snappy/uncompress ba 0 (alength ba))) \ No newline at end of file