Thread
#kotlinx-files
    altavir

    altavir

    3 years ago
    Another use-case for io: I need to redirect input to output. The best solution without creating intermediate buffer I found is to write:
    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.
    Dominaezzz

    Dominaezzz

    3 years ago
    Isn't there a
    Input.copyTo(Output)
    function?
    Unless it hasn't been published yet.
    altavir

    altavir

    3 years ago
    I'll check, thanks
    Yeah, it is in extensions. Thanks