https://kotlinlang.org logo
a

altavir

05/23/2019, 7:10 PM
Another use-case for io: I need to redirect input to output. The best solution without creating intermediate buffer I found is to write:
Copy code
while (!endOfInput){
    out.writeByte(readByte())
}
If I understand current IO logic correctly, the input in general has a sequence of pooled buffers, so it would be simple to redirect those buffers directly to the output, but I can't find a way to do it with current API.
d

Dominaezzz

05/23/2019, 11:21 PM
Isn't there a
Input.copyTo(Output)
function?
Unless it hasn't been published yet.
a

altavir

05/24/2019, 5:31 AM
I'll check, thanks
Yeah, it is in extensions. Thanks
2 Views