read

abstract fun read(position: Long, buffer: ByteArray, offset: Int, length: Int): Int(source)

Reads up to length bytes starting at file offset position into buffer at offset.

Return

the number of bytes read (> 0 when length> 0), or -1 if position is at or past the end.