read

abstract suspend fun read(into: ByteArray, offset: Int, length: Int): Int

Reads at most length bytes into into at offset and advances the cursor.

Return

the count of bytes read, at least 1, or -1 at the end. Never 0. A count above length fails the operation, and none of those bytes are used.