Is it possible to convert a `kotlinx.io.core.ByteR...
# announcements
w
Is it possible to convert a
kotlinx.io.core.ByteReadChannel
to a
kotlinx.io.core.BytePacketBuilder
? From reading the code the both do similar things.
d
The first does input and the second does output.
What do you expect the conversion to do? Empty the channel into the builder?
w
Ah thanks that makes a lot of sense. Yes that's exactly what I'm looking for. I have a channel as input and an api which requires a builder. Is there any library function or do I have to write it myself?
d
You kinda have to write it yourself, you can use this as guidance https://github.com/Kotlin/kotlinx-io/blob/master/ReadMe.md#bytepacketbuilder
w
Gotcha, thanks for your help