carboniteKryo 的 Clojure 移植版本
carbonite 是 Kryo 序列化框架的 Clojure 的移植版本。
示例代码:
;; Initialize a registry with the default serializers (covering most Java and Clojure data) (def registry (default-registry)) ;; Serialize my-data (any Clojure data) into the ByteBuffer b (def b (new-buffer 1024)) (write-buffer registry b my-data)) ;; Rewind buffer back to the beginning (.rewind b) ;; Deserialize buffer back to Clojure data (def c (read-buffer registry b)))
评论