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

fun readDirect(block: (<ERROR CLASS><<ERROR CLASS>>) -> Int): Int

Apply block to a native pointer for reading from the buffer. Lambda should return number of bytes were read.

Return

number of bytes read