clj-commons / clj-commons/byte-streams

(bs/to-byte-array []) fails

Open
#19 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
430
Forks
31
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.