MemoryReader

interface MemoryReader

The interface to read primitive types in this memory.

Functions

readByte
Link copied to clipboard
common
abstract fun readByte(offset: Int): Byte
Reads Byte at certain offset.
readDouble
Link copied to clipboard
common
abstract fun readDouble(offset: Int): Double
Reads Double at certain offset.
readFloat
Link copied to clipboard
common
abstract fun readFloat(offset: Int): Float
Reads Float at certain offset.
readInt
Link copied to clipboard
common
abstract fun readInt(offset: Int): Int
Reads Int at certain offset.
readLong
Link copied to clipboard
common
abstract fun readLong(offset: Int): Long
Reads Long at certain offset.
readShort
Link copied to clipboard
common
abstract fun readShort(offset: Int): Short
Reads Short at certain offset.
release
Link copied to clipboard
common
abstract fun release()
Disposes this reader if needed.

Properties

memory
Link copied to clipboard
common
abstract val memory: Memory
The underlying memory.

Extensions

read
Link copied to clipboard
common
fun <T : Any> MemoryReader.read(spec: MemorySpec<T>, offset: Int): T
Reads the object with spec starting from offset.
readArray
Link copied to clipboard
common
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.