https://kotlinlang.org logo
k

Kroppeb

09/02/2019, 6:48 PM
I have a
kotlinx.coroutines.io.ByteReadChannel
. How do I read a utf8String of certain length?
d

Dominaezzz

09/02/2019, 7:22 PM
I don't think you can read from that.
k

Kroppeb

09/02/2019, 7:28 PM
You can read a utf8line but not a fixed size string?
Oh I meant read channel, I'll edit
d

Dominaezzz

09/02/2019, 7:36 PM
Ah, you'll probably have to use a string builder and loop.
k

Kroppeb

09/02/2019, 8:14 PM
You can't even read a char though?
d

Dominaezzz

09/02/2019, 8:17 PM
You can do this with
readUTF8LineTo
.
k

Kroppeb

09/02/2019, 8:46 PM
How, Doesn't that read a whole line?
d

Dominaezzz

09/02/2019, 10:04 PM
You can give it a limit.
k

Kroppeb

09/02/2019, 10:59 PM
It throws an exception if it surpasses that limit iirc
7 Views