-
Couldn't load subscription status.
- Fork 1.4k
Add a method for converting ZStream[Byte] to a ZManaged[java.io.InputStream] #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f4beab7 to
17f418b
Compare
|
@sideeffffect what do you think of mixing the platform-specific trait directly into ZStream and using implicit evidence instead of implicit classes? |
|
Oh actually someone pointed out in another PR that ScalaJS has InputStream. So we can move this code directly into ZStream. |
|
Should we read more than a single byte on every |
|
|
|
there is |
52b1875 to
bd88f56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small fix and this is ready to go!
…ream # Conflicts: # streams-tests/jvm/src/test/scala/zio/stream/StreamChunkSpec.scala
|
Ok, needs a quick rebase and we're good |
|
@iravid so are we sure that the overhead of |
|
@sideeffffect Chunk definitely has some overhead, but I believe that's offset by the utility of combinators available on ZStreamChunk. We're also designing the rest of the library to always return chunks, rather than arrays, when applicable - e.g. |
|
my builds are now failing with and I don't know how my changes could introduce such a problem... :-/ does it happen also in |
59f72a5 to
4241dc1
Compare
| } yield (chunk, i) | ||
|
|
||
| def chunkGen[R <: Random, A: ClassTag](a: Gen[R, A], max: Int): Gen[R with Sized, Chunk[A]] = | ||
| private def chunkGen[R <: Random, A: ClassTag](a: Gen[R, A], max: Int): Gen[R with Sized, Chunk[A]] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this public? No reason for it to be private.
|
@iravid ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @sideeffffect. Thanks for contributing this!
fixes #1730