RandomAccessInput

Random Access Index API. Unlike IndexInput, this has no concept of file position, all reads are absolute. However, like IndexInput, it is only intended for use by a single thread.

Inheritors

Functions

Link copied to clipboard
abstract fun length(): Long

The number of bytes in the file.

Link copied to clipboard
open fun prefetch(offset: Long, length: Long)

Prefetch data in the background.

Link copied to clipboard
abstract fun readByte(pos: Long): Byte

Reads a byte at the given position in the file

Link copied to clipboard
open fun readBytes(pos: Long, bytes: ByteArray, offset: Int, length: Int)

Reads a specified number of bytes starting at a given position into an array at the specified offset.

Link copied to clipboard
abstract fun readInt(pos: Long): Int

Reads an integer (LE byte order) at the given position in the file

Link copied to clipboard
abstract fun readLong(pos: Long): Long

Reads a long (LE byte order) at the given position in the file

Link copied to clipboard
abstract fun readShort(pos: Long): Short

Reads a short (LE byte order) at the given position in the file