clj-commons / gloss

speaks in bytes, so you don't have to
Eclipse Public License 1.0
483 stars 57 forks source link

convert-sequence does not accept java byte arrays #22

Closed Jared314 closed 8 years ago

Jared314 commented 11 years ago

I'm using gloss for interaction with an existing binary protocol that requires a lot of hashing. I find myself constantly wrapping my data, java byte arrays "[B", in sequences. Is this intended?

Example:

(defcodec something (ordered-map
                     ...
                     :attr1 (repeat 32 :ubyte)
                     ...))
(def value1 (byte-array (repeat 32 (byte 0))))
(encode something {...
                   :attr1 value1 ;Exception in convert-sequence
                   ...})