readAtMost

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

Reads at most len bytes from the data source starting at the given pos into the buf array, starting at offset off.

Return

The number of bytes actually read, or 0 if the end of data is reached

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 an I/O error occurs


Reads at most buf.size bytes from the data source starting at the 32-bit pos into the given buf.

Return

The number of bytes actually read, or 0 if the end of data is reached

Parameters

pos

The starting 32-bit address in the data source

buf

The destination byte array

Throws

If an I/O error occurs


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

Reads at most len bytes from the data source starting at the given pos into the buf array, starting at offset off.

Return

The number of bytes actually read, or 0 if the end of data is reached

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 an I/O error occurs


Reads at most buf.size bytes from the data source starting at the 64-bit pos into the given buf.

Return

The number of bytes actually read, or 0 if the end of data is reached

Parameters

pos

The starting 64-bit address in the data source

buf

The destination byte array

Throws

If an I/O error occurs