readFully

inline fun DataAccessor.readFully(pos: Address32, buf: ByteArray, off: Int, len: Int)(source)

Reads exactly len bytes starting at the 32-bit pos into buf, beginning at offset off.

Parameters

pos

The starting 32-bit address in the data source

buf

The destination byte array

off

The starting offset in the buffer (must be in [0, buf.size))

len

The maximum number of bytes to read (must be in 0, buf.size - off)

Throws

If the end of data is reached before reading all bytes

If any of off or len are invalid

If an I/O error occurs


Reads exactly buf.size bytes starting at the 32-bit pos into the buffer.

Parameters

pos

The starting 32-bit address in the data source

buf

The destination byte array

Throws

If the end of data is reached before reading all bytes

If an I/O error occurs


inline fun DataAccessor.readFully(pos: Address64, buf: ByteArray, off: Int, len: Int)(source)

Reads exactly len bytes starting at the 64-bit pos into buf, beginning at offset off.

Parameters

pos

The starting 64-bit address in the data source

buf

The destination byte array

off

The starting offset in the buffer (must be in [0, buf.size))

len

The maximum number of bytes to read (must be in 0, buf.size - off)

Throws

If the end of data is reached before reading all bytes

If any of off or len are invalid

If an I/O error occurs


Reads exactly buf.size bytes starting at the 64-bit pos into the buffer.

Parameters

pos

The starting 64-bit address in the data source

buf

The destination byte array

Throws

If the end of data is reached before reading all bytes

If an I/O error occurs