You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this by design? I would expect to get an empty byte array instead.
=> (bs/to-byte-array [])
IllegalArgumentException Don't know how to convert class clojure.lang.PersistentVector into class [B byte-streams/convert (byte_streams.clj:187)
Since (bs/to-byte-array [(byte-array [2 3 4]) (byte-array [5 6])]) works, the behavior seems surprising to me. It requires checking that the array is not empty before calling to-byte-array.
The text was updated successfully, but these errors were encountered:
Currently byte-streams doesn't handle nil or empty sequences, mostly because I haven't thought through all the implications of (for instance) implicitly transforming nil into an empty byte-array. I agree, though, that it puts an unfortunate burden on you. Leaving this issue open until I have a better answer.
Is this by design? I would expect to get an empty byte array instead.
Since
(bs/to-byte-array [(byte-array [2 3 4]) (byte-array [5 6])])
works, the behavior seems surprising to me. It requires checking that the array is not empty before callingto-byte-array
.The text was updated successfully, but these errors were encountered: