ktor-io / io.ktor.utils.io / ByteChannelSequentialBase / readAvailable

readAvailable

open suspend fun readAvailable(dst: IoBuffer): Int

Overrides ByteReadChannel.readAvailable

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

Overrides ByteReadChannel.readAvailable

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