MemoryReader

interface MemoryReader

The interface to read primitive types in this memory.

Functions

Link copied to clipboard
abstract fun readByte(offset: Int): Byte

Reads Byte at certain offset.

Link copied to clipboard
abstract fun readDouble(offset: Int): Double

Reads Double at certain offset.

Link copied to clipboard
abstract fun readFloat(offset: Int): Float

Reads Float at certain offset.

Link copied to clipboard
abstract fun readInt(offset: Int): Int

Reads Int at certain offset.

Link copied to clipboard
abstract fun readLong(offset: Int): Long

Reads Long at certain offset.

Link copied to clipboard
abstract fun readShort(offset: Int): Short

Reads Short at certain offset.

Link copied to clipboard
abstract fun release()

Disposes this reader if needed.

Properties

Link copied to clipboard
abstract val memory: Memory

The underlying memory.

Extensions

Link copied to clipboard
fun <T : Any> MemoryReader.read(spec: MemorySpec<T>, offset: Int): T

Reads the object with spec starting from offset.

Link copied to clipboard
inline fun <T : Any> MemoryReader.readArray(spec: MemorySpec<T>, offset: Int, size: Int): Array<T>

Reads array of size objects mapped by spec at certain offset.

Sources

Link copied to clipboard