https://kotlinlang.org logo
Title
w

wollnyst

01/29/2019, 2:20 PM
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

Dominaezzz

01/29/2019, 3:20 PM
The first does input and the second does output.
What do you expect the conversion to do? Empty the channel into the builder?
w

wollnyst

01/29/2019, 3:42 PM
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

Dominaezzz

01/29/2019, 3:46 PM
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

wollnyst

01/29/2019, 3:49 PM
Gotcha, thanks for your help