clj-commons / clj-commons/byte-streams
Can't convert stream of byte arrays to seq of byte arrays
- Dominant language
- Clojure
- Stars
- 430
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
When I try to convert a stream of byte arrays to a seq of byte arrays, it just returns back the original stream without doing any conversion.
```clojure
user=> (require '[manifold.stream :as ms])
user=> (require '[byte-streams :as bs])
user=> (def content (doto (ms/stream) (ms/put! (byte-array 5)) (ms/close!)))
#'user/content
user=> (bs/convert content (bs/seq-of bytes)) ; doesn't work
#
user=> (bs/convert content (bs/seq-of String)) ; also doesn't work
#
user=> (bs/convert content (bs/seq-of java.nio.ByteBuffer)) ; this works
(#)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported REPL example with manifold.stream and byte-streams, then inspect the conversion path behind bs/convert and bs/seq-of for streams of byte arrays. Compare it with the working java.nio.ByteBuffer case; done means byte-array and String targets produce the requested sequence instead of returning the original stream.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100