read

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

Copy up to length bytes, starting at position, into into from offset. Returns how many bytes it copied, or -1 when position is at or past size. A short count is not an error: the reader asks again for the rest. A read that throws counts as damaged bytes, so the entry it serves becomes unreadable, as a truncated file would make it.