Bump dependency (snappy 0.3), simplify utils/compress-bytes
This commit is contained in:
parent
a1676c8063
commit
eb9e828647
2 changed files with 4 additions and 12 deletions
|
|
@ -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"]]}
|
||||
|
|
|
|||
|
|
@ -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")))))
|
||||
(defn compress-bytes [^bytes ba] (Snappy/compress ba))
|
||||
(defn uncompress-bytes [^bytes ba] (Snappy/uncompress ba 0 (alength ba)))
|
||||
Loading…
Reference in a new issue