readAvailable

abstract suspend fun readAvailable(
    dst: ByteArray,
    offset: Int,
    length: Int
): Int

Reads all available bytes to dst buffer and returns immediately or suspends if no bytes available

Return number of bytes were read or -1 if the channel has been closed

open suspend fun readAvailable(dst: ByteArray): Int
abstract suspend fun readAvailable(dst: ByteBuffer): Int
abstract suspend fun readAvailable(dst: BufferView): Int