read

fun read(fileOffset: Long, array: ByteArray, arrayOffset: Int, byteCount: Int): Int

Reads at least 1, and up to byteCount bytes from this starting at fileOffset and copies them to array at arrayOffset. Returns the number of bytes read, or -1 if fileOffset equals size.


fun read(fileOffset: Long, sink: Buffer, byteCount: Long): Long

Reads at least 1, and up to byteCount bytes from this starting at fileOffset and appends them to sink. Returns the number of bytes read, or -1 if fileOffset equals size.