Skip to content

Commit

Permalink
use babel instead of sb-ext for string to octet translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraison committed Aug 31, 2011
1 parent f6c01d2 commit 8a91ff8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deserialize.lisp
Expand Up @@ -50,14 +50,14 @@
(array (make-array length :element-type '(unsigned-byte 8))))
(dotimes (i length)
(setf (aref array i) (read-byte stream)))
(sb-ext:octets-to-string array)))
(babel:octets-to-string array)))

(defmethod deserialize ((code (eql +compressed-string+)) stream)
(let* ((length (deserialize (read-byte stream) stream))
(array (make-array length :element-type '(unsigned-byte 8))))
(dotimes (i length)
(setf (aref array i) (read-byte stream)))
(sb-ext:octets-to-string (chipz:decompress nil 'chipz:zlib array))))
(babel:octets-to-string (chipz:decompress nil 'chipz:zlib array))))

(defmethod deserialize ((code (eql +t+)) stream)
t)
Expand Down
4 changes: 2 additions & 2 deletions serialize.lisp
Expand Up @@ -50,13 +50,13 @@
;; FIXME: what is the right length to enable compression?
(if (and *compression-enabled?* (> (length string) 20))
(let* ((comp (salza2:compress-data
(sb-ext:string-to-octets string) 'salza2:zlib-compressor))
(babel:string-to-octets string) 'salza2:zlib-compressor))
(length (length comp)))
(write-byte +compressed-string+ stream)
(serialize length stream)
(dotimes (i length)
(write-byte (aref comp i) stream)))
(let* ((unicode (sb-ext:string-to-octets string))
(let* ((unicode (babel:string-to-octets string))
(length (length unicode)))
(write-byte +string+ stream)
(serialize length stream)
Expand Down
1 change: 1 addition & 0 deletions vivace-graph-v2.asd
Expand Up @@ -12,6 +12,7 @@
:long-description "Vivace Graph Version 2."
:depends-on (:sb-concurrency
:sb-posix
:babel
:cffi
:bordeaux-threads
;;:cl-btree-0.5
Expand Down

0 comments on commit 8a91ff8

Please sign in to comment.