ktor-io / io.ktor.utils.io.core / IoBuffer / readDirect

readDirect

inline fun readDirect(block: (ByteBuffer) -> Unit): Int

Apply block function on a ByteBuffer of readable bytes. The block function should return number of consumed bytes.

Return
number of bytes consumed