Package-level declarations

Types

Link copied to clipboard
interface Allocator
Link copied to clipboard
expect abstract class Memory

Represents a linear range of bytes. All operations are guarded by range-checks by default however at some platforms they could be disabled in release builds.

actual abstract class Memory

Represents a linear range of bytes. All operations are guarded by range-checks by default however at some platforms they could be disabled in release builds.

actual typealias Memory = ByteBuffer

Represents a linear range of bytes. All operations are guarded by range-checks by default however at some platforms they could be disabled in release builds.

actual abstract class Memory

Represents a linear range of bytes. All operations are guarded by range-checks by default however at some platforms they could be disabled in release builds.

Properties

Link copied to clipboard

Reference to the internal buffer

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect val MEMORY_EMPTY: Memory

Memory instance with 0 size.

actual val MEMORY_EMPTY: Memory

Memory instance with 0 size.

actual val MEMORY_EMPTY: Memory

Memory instance with 0 size.

actual val MEMORY_EMPTY: Memory

Memory instance with 0 size.

Link copied to clipboard
expect val Memory.size: Long

Size of memory range in bytes.

actual val Memory.size: Long

Size of memory range in bytes.

actual val Memory.size: Long

Size of memory range in bytes.

Link copied to clipboard
expect val Memory.size32: Int

Size of memory range in bytes represented as signed 32bit integer

actual val Memory.size32: Int

Size of memory range in bytes represented as signed 32bit integer

actual val Memory.size32: Int

Size of memory range in bytes represented as signed 32bit integer

Functions

Link copied to clipboard

Allocate memory range having the specified size in bytes and provide an instance of Memory view for this range. Please note that depending of the placement type (e.g. scoped or global) this memory instance may require explicit release using free on the same placement. In particular, instances created inside of memScoped block do not require to be released explicitly but once the scope is leaved, all produced instances should be discarded and should be never used after the scope. On the contrary instances created using nativeHeap do require release via nativeHeap.free.

Link copied to clipboard
fun Memory.copyTo(destination: ByteArray, offset: Int, length: Int)
fun Memory.copyTo(destination: ByteArray, offset: Long, length: Int)

Copies bytes from this memory range from the specified offset and length to the destination.

expect fun Memory.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int)
expect fun Memory.copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long)

Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset. Copying bytes from a memory to itself is allowed.

expect fun Memory.copyTo(destination: ByteArray, offset: Int, length: Int, destinationOffset: Int)
expect fun Memory.copyTo(destination: ByteArray, offset: Long, length: Int, destinationOffset: Int)

Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset.

actual fun Memory.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int)
actual fun Memory.copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long)

Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset. Copying bytes from a memory to itself is allowed.

actual fun Memory.copyTo(destination: ByteArray, offset: Int, length: Int, destinationOffset: Int)
actual fun Memory.copyTo(destination: ByteArray, offset: Long, length: Int, destinationOffset: Int)
fun Memory.copyTo(destination: ArrayBuffer, offset: Int, length: Int, destinationOffset: Int)
fun Memory.copyTo(destination: ArrayBufferView, offset: Int, length: Int, destinationOffset: Int)
fun ArrayBuffer.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int)
fun ArrayBufferView.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int)

Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset.

fun Memory.copyTo(destination: ByteBuffer, offset: Int)
fun Memory.copyTo(destination: ByteBuffer, offset: Long)

Copies bytes from this memory range from the specified offset to the destination buffer.

actual fun Memory.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int)
actual fun Memory.copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long)

Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset. Copying bytes from a memory to itself is allowed.

actual fun Memory.copyTo(destination: ByteArray, offset: Int, length: Int, destinationOffset: Int)
actual fun Memory.copyTo(destination: ByteArray, offset: Long, length: Int, destinationOffset: Int)

Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset.

fun Memory.copyTo(destination: CPointer<ByteVar>, offset: Int, length: Int, destinationOffset: Int)
fun Memory.copyTo(destination: CPointer<ByteVar>, offset: Long, length: Long, destinationOffset: Long)

Copy content bytes to the memory addressed by the destination pointer with the specified destinationOffset in bytes.

fun CPointer<ByteVar>.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int)
fun CPointer<ByteVar>.copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long)

Copy length bytes to the destination at the specified destinationOffset from the memory addressed by this pointer with offset in bytes.

Link copied to clipboard
expect fun Memory.fill(offset: Int, count: Int, value: Byte)
expect fun Memory.fill(offset: Long, count: Long, value: Byte)

Fill memory range starting at the specified offset with value repeated count times.

actual fun Memory.fill(offset: Int, count: Int, value: Byte)
actual fun Memory.fill(offset: Long, count: Long, value: Byte)

Fill memory range starting at the specified offset with value repeated count times.

actual fun Memory.fill(offset: Int, count: Int, value: Byte)
actual fun Memory.fill(offset: Long, count: Long, value: Byte)

Fill memory range starting at the specified offset with value repeated count times.

Link copied to clipboard

Release resources that the memory instance is holding. This function should be only used for memory instances that are produced by allocMemory function otherwise an undefined behaviour may occur including crash or data corruption.

Link copied to clipboard
inline operator fun Memory.get(index: Int): Byte
inline operator fun Memory.get(index: Long): Byte

Read byte at the specified index.

Link copied to clipboard
expect inline fun Memory.loadAt(index: Int): Byte
expect inline fun Memory.loadAt(index: Long): Byte

Returns byte at index position.

actual inline fun Memory.loadAt(index: Int): Byte
actual inline fun Memory.loadAt(index: Long): Byte

Returns byte at index position.

actual inline fun Memory.loadAt(index: Int): Byte
actual inline fun Memory.loadAt(index: Long): Byte

Returns byte at index position.

Link copied to clipboard
inline fun Memory.loadByteArray(offset: Int, destination: ByteArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies bytes from this memory range from the specified offset and count to the destination at destinationOffset.

inline fun Memory.loadByteArray(offset: Long, destination: ByteArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies unsigned shorts integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect fun Memory.loadDoubleArray(offset: Int, destination: DoubleArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
expect fun Memory.loadDoubleArray(offset: Long, destination: DoubleArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies floating point numbers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadDoubleArray(offset: Int, destination: DoubleArray, destinationOffset: Int, count: Int)
actual fun Memory.loadDoubleArray(offset: Long, destination: DoubleArray, destinationOffset: Int, count: Int)

Copies floating point numbers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadDoubleArray(offset: Int, destination: DoubleArray, destinationOffset: Int, count: Int)
actual fun Memory.loadDoubleArray(offset: Long, destination: DoubleArray, destinationOffset: Int, count: Int)

Copies floating point numbers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.loadDoubleAt(offset: Int): Double
expect inline fun Memory.loadDoubleAt(offset: Long): Double

Read short signed 64bit floating point number in the network byte order (Big Endian)

actual inline fun Memory.loadDoubleAt(offset: Int): Double
actual inline fun Memory.loadDoubleAt(offset: Long): Double
actual inline fun Memory.loadDoubleAt(offset: Int): Double
actual inline fun Memory.loadDoubleAt(offset: Long): Double
Link copied to clipboard
expect fun Memory.loadFloatArray(offset: Int, destination: FloatArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
expect fun Memory.loadFloatArray(offset: Long, destination: FloatArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies floating point numbers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadFloatArray(offset: Int, destination: FloatArray, destinationOffset: Int, count: Int)
actual fun Memory.loadFloatArray(offset: Long, destination: FloatArray, destinationOffset: Int, count: Int)

Copies floating point numbers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadFloatArray(offset: Int, destination: FloatArray, destinationOffset: Int, count: Int)
actual fun Memory.loadFloatArray(offset: Long, destination: FloatArray, destinationOffset: Int, count: Int)

Copies floating point numbers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.loadFloatAt(offset: Int): Float
expect inline fun Memory.loadFloatAt(offset: Long): Float

Read short signed 32bit floating point number in the network byte order (Big Endian)

actual inline fun Memory.loadFloatAt(offset: Int): Float
actual inline fun Memory.loadFloatAt(offset: Long): Float
actual inline fun Memory.loadFloatAt(offset: Int): Float
actual inline fun Memory.loadFloatAt(offset: Long): Float
Link copied to clipboard
expect fun Memory.loadIntArray(offset: Int, destination: IntArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
expect fun Memory.loadIntArray(offset: Long, destination: IntArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies regular integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadIntArray(offset: Int, destination: IntArray, destinationOffset: Int, count: Int)
actual fun Memory.loadIntArray(offset: Long, destination: IntArray, destinationOffset: Int, count: Int)

Copies regular integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadIntArray(offset: Int, destination: IntArray, destinationOffset: Int, count: Int)
actual fun Memory.loadIntArray(offset: Long, destination: IntArray, destinationOffset: Int, count: Int)

Copies regular integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.loadIntAt(offset: Int): Int
expect inline fun Memory.loadIntAt(offset: Long): Int

Read regular signed 32bit integer in the network byte order (Big Endian)

actual inline fun Memory.loadIntAt(offset: Int): Int
actual inline fun Memory.loadIntAt(offset: Long): Int
actual inline fun Memory.loadIntAt(offset: Int): Int
actual inline fun Memory.loadIntAt(offset: Long): Int
Link copied to clipboard
expect fun Memory.loadLongArray(offset: Int, destination: LongArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
expect fun Memory.loadLongArray(offset: Long, destination: LongArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies long integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadLongArray(offset: Int, destination: LongArray, destinationOffset: Int, count: Int)
actual fun Memory.loadLongArray(offset: Long, destination: LongArray, destinationOffset: Int, count: Int)

Copies regular integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadLongArray(offset: Int, destination: LongArray, destinationOffset: Int, count: Int)
actual fun Memory.loadLongArray(offset: Long, destination: LongArray, destinationOffset: Int, count: Int)

Copies regular integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.loadLongAt(offset: Int): Long
expect inline fun Memory.loadLongAt(offset: Long): Long

Read short signed 64bit integer in the network byte order (Big Endian)

actual inline fun Memory.loadLongAt(offset: Int): Long
actual inline fun Memory.loadLongAt(offset: Long): Long
actual inline fun Memory.loadLongAt(offset: Int): Long
actual inline fun Memory.loadLongAt(offset: Long): Long
Link copied to clipboard
expect fun Memory.loadShortArray(offset: Int, destination: ShortArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
expect fun Memory.loadShortArray(offset: Long, destination: ShortArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies short integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadShortArray(offset: Int, destination: ShortArray, destinationOffset: Int, count: Int)
actual fun Memory.loadShortArray(offset: Long, destination: ShortArray, destinationOffset: Int, count: Int)

Copies short integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

actual fun Memory.loadShortArray(offset: Int, destination: ShortArray, destinationOffset: Int, count: Int)
actual fun Memory.loadShortArray(offset: Long, destination: ShortArray, destinationOffset: Int, count: Int)

Copies short integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.loadShortAt(offset: Int): Short
expect inline fun Memory.loadShortAt(offset: Long): Short

Read short signed 16bit integer in the network byte order (Big Endian)

actual inline fun Memory.loadShortAt(offset: Int): Short
actual inline fun Memory.loadShortAt(offset: Long): Short
actual inline fun Memory.loadShortAt(offset: Int): Short
actual inline fun Memory.loadShortAt(offset: Long): Short
Link copied to clipboard
inline fun Memory.loadUByteArray(offset: Int, destination: UByteArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
inline fun Memory.loadUByteArray(offset: Long, destination: UByteArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies unsigned shorts integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.loadUIntArray(offset: Int, destination: UIntArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
inline fun Memory.loadUIntArray(offset: Long, destination: UIntArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies unsigned integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.loadUIntAt(offset: Int): UInt
inline fun Memory.loadUIntAt(offset: Long): UInt

Read regular unsigned 32bit integer in the network byte order (Big Endian)

Link copied to clipboard
inline fun Memory.loadULongArray(offset: Int, destination: ULongArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
inline fun Memory.loadULongArray(offset: Long, destination: ULongArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies unsigned long integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.loadULongAt(offset: Int): ULong
inline fun Memory.loadULongAt(offset: Long): ULong

Read short signed 64bit integer in the network byte order (Big Endian)

Link copied to clipboard
inline fun Memory.loadUShortArray(offset: Int, destination: UShortArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)
inline fun Memory.loadUShortArray(offset: Long, destination: UShortArray, destinationOffset: Int = 0, count: Int = destination.size - destinationOffset)

Copies unsigned shorts integers from this memory range from the specified offset and count to the destination at destinationOffset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.loadUShortAt(offset: Int): UShort
inline fun Memory.loadUShortAt(offset: Long): UShort

Read short unsigned 16bit integer in the network byte order (Big Endian)

Link copied to clipboard
fun Memory(view: DataView): Memory

fun Memory(array: ByteArray, offset: Int = 0, length: Int = array.size - offset): Memory

Create Memory view for the specified array range starting at offset and the specified bytes length.

fun Memory(buffer: ArrayBuffer, offset: Int = 0, length: Int = buffer.byteLength - offset): Memory

Create Memory view for the specified buffer range starting at offset and the specified bytes length.

fun Memory(view: ArrayBufferView, offset: Int = 0, length: Int = view.byteLength): Memory

Create Memory view for the specified view range starting at offset and the specified bytes length.

Create memory form buffer.

inline fun Memory(array: ByteArray, offset: Int = 0, length: Int = array.size - offset): Memory

Create Memory view for the specified array range starting at offset and the specified bytes length.

inline fun Memory(pointer: CPointer<*>, size: Int): Memory
inline fun Memory(pointer: CPointer<*>, size: Long): Memory
inline fun Memory(pointer: CPointer<*>, size: size_t): Memory

Create an instance of Memory view for memory region starting at the specified pointer and having the specified size in bytes.

fun Memory(pointer: CPointer<ByteVar>, size: Long): Memory

Create memory instance from the pointer with specified size.

Link copied to clipboard
fun ByteBuffer.moveTo(destination: Memory, offset: Int)

Copy byte from this buffer moving it's position to the destination at offset.

Link copied to clipboard
actual fun Int.reverseByteOrder(): Int
actual fun Long.reverseByteOrder(): Long

Reverse number's byte order

actual inline fun Double.reverseByteOrder(): Double
actual inline fun Float.reverseByteOrder(): Float
actual inline fun Int.reverseByteOrder(): Int
actual inline fun Long.reverseByteOrder(): Long
actual inline fun Short.reverseByteOrder(): Short

Reverse number's byte order

actual fun Int.reverseByteOrder(): Int
actual fun Long.reverseByteOrder(): Long

Reverse number's byte order

Link copied to clipboard
inline operator fun Memory.set(index: Int, value: Byte)
inline operator fun Memory.set(index: Long, value: Byte)

Index write operator to write value at the specified index

Link copied to clipboard
expect fun Memory.slice(offset: Int, length: Int): Memory
expect fun Memory.slice(offset: Long, length: Long): Memory

Returns memory's subrange. On some platforms it could do range checks but it is not guaranteed to be safe. It also could lead to memory allocations on some platforms.

actual fun Memory.slice(offset: Int, length: Int): Memory
actual fun Memory.slice(offset: Long, length: Long): Memory

Returns memory's subrange. On some platforms it could do range checks but it is not guaranteed to be safe. It also could lead to memory allocations on some platforms.

actual fun Memory.slice(offset: Int, length: Int): Memory
actual fun Memory.slice(offset: Long, length: Long): Memory
Link copied to clipboard
expect inline fun Memory.storeAt(index: Int, value: Byte)

Write value at the specified index.

inline fun Memory.storeAt(index: Int, value: UByte)
inline fun Memory.storeAt(index: Long, value: UByte)

Index write operator to write value at the specified index

expect inline fun Memory.storeAt(index: Long, value: Byte)

Write value at the specified index

actual inline fun Memory.storeAt(index: Int, value: Byte)

Write value at the specified index.

actual inline fun Memory.storeAt(index: Long, value: Byte)

Write value at the specified index

actual inline fun Memory.storeAt(index: Int, value: Byte)

Write value at the specified index.

actual inline fun Memory.storeAt(index: Long, value: Byte)

Write value at the specified index

Link copied to clipboard
inline fun Memory.storeByteArray(offset: Int, source: ByteArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
inline fun Memory.storeByteArray(offset: Long, source: ByteArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies unsigned shorts integers from the source array at sourceOffset to this memory at the specified offset.

Link copied to clipboard
expect fun Memory.storeDoubleArray(offset: Int, source: DoubleArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
expect fun Memory.storeDoubleArray(offset: Long, source: DoubleArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies floating point numbers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeDoubleArray(offset: Int, source: DoubleArray, sourceOffset: Int, count: Int)
actual fun Memory.storeDoubleArray(offset: Long, source: DoubleArray, sourceOffset: Int, count: Int)

Copies floating point numbers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeDoubleArray(offset: Int, source: DoubleArray, sourceOffset: Int, count: Int)
actual fun Memory.storeDoubleArray(offset: Long, source: DoubleArray, sourceOffset: Int, count: Int)

Copies floating point numbers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.storeDoubleAt(offset: Int, value: Double)
expect inline fun Memory.storeDoubleAt(offset: Long, value: Double)

Write short signed 64bit floating point number in the network byte order (Big Endian)

actual inline fun Memory.storeDoubleAt(offset: Int, value: Double)
actual inline fun Memory.storeDoubleAt(offset: Long, value: Double)

Write short signed 64bit floating point number in the network byte order (Big Endian)

actual inline fun Memory.storeDoubleAt(offset: Int, value: Double)
actual inline fun Memory.storeDoubleAt(offset: Long, value: Double)

Write short signed 64bit floating point number in the network byte order (Big Endian)

Link copied to clipboard
expect fun Memory.storeFloatArray(offset: Int, source: FloatArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
expect fun Memory.storeFloatArray(offset: Long, source: FloatArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies floating point numbers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeFloatArray(offset: Int, source: FloatArray, sourceOffset: Int, count: Int)
actual fun Memory.storeFloatArray(offset: Long, source: FloatArray, sourceOffset: Int, count: Int)

Copies floating point numbers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeFloatArray(offset: Int, source: FloatArray, sourceOffset: Int, count: Int)
actual fun Memory.storeFloatArray(offset: Long, source: FloatArray, sourceOffset: Int, count: Int)

Copies floating point numbers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.storeFloatAt(offset: Int, value: Float)
expect inline fun Memory.storeFloatAt(offset: Long, value: Float)

Write short signed 32bit floating point number in the network byte order (Big Endian)

actual inline fun Memory.storeFloatAt(offset: Int, value: Float)
actual inline fun Memory.storeFloatAt(offset: Long, value: Float)

Write short signed 32bit floating point number in the network byte order (Big Endian)

actual inline fun Memory.storeFloatAt(offset: Int, value: Float)
actual inline fun Memory.storeFloatAt(offset: Long, value: Float)

Write short signed 32bit floating point number in the network byte order (Big Endian)

Link copied to clipboard
expect fun Memory.storeIntArray(offset: Int, source: IntArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
expect fun Memory.storeIntArray(offset: Long, source: IntArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies regular integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeIntArray(offset: Int, source: IntArray, sourceOffset: Int, count: Int)
actual fun Memory.storeIntArray(offset: Long, source: IntArray, sourceOffset: Int, count: Int)

Copies regular integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeIntArray(offset: Int, source: IntArray, sourceOffset: Int, count: Int)
actual fun Memory.storeIntArray(offset: Long, source: IntArray, sourceOffset: Int, count: Int)

Copies regular integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.storeIntAt(offset: Int, value: Int)
expect inline fun Memory.storeIntAt(offset: Long, value: Int)

Write regular signed 32bit integer in the network byte order (Big Endian)

actual inline fun Memory.storeIntAt(offset: Int, value: Int)
actual inline fun Memory.storeIntAt(offset: Long, value: Int)

Write regular signed 32bit integer in the network byte order (Big Endian)

actual inline fun Memory.storeIntAt(offset: Int, value: Int)
actual inline fun Memory.storeIntAt(offset: Long, value: Int)

Write regular signed 32bit integer in the network byte order (Big Endian)

Link copied to clipboard
expect fun Memory.storeLongArray(offset: Int, source: LongArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
expect fun Memory.storeLongArray(offset: Long, source: LongArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies long integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeLongArray(offset: Int, source: LongArray, sourceOffset: Int, count: Int)
actual fun Memory.storeLongArray(offset: Long, source: LongArray, sourceOffset: Int, count: Int)

Copies regular integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeLongArray(offset: Int, source: LongArray, sourceOffset: Int, count: Int)
actual fun Memory.storeLongArray(offset: Long, source: LongArray, sourceOffset: Int, count: Int)

Copies regular integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.storeLongAt(offset: Int, value: Long)

Write short signed 64bit integer in the network byte order (Big Endian)

expect inline fun Memory.storeLongAt(offset: Long, value: Long)

write short signed 64bit integer in the network byte order (Big Endian)

actual inline fun Memory.storeLongAt(offset: Int, value: Long)
actual inline fun Memory.storeLongAt(offset: Long, value: Long)

Write short signed 64bit integer in the network byte order (Big Endian)

actual inline fun Memory.storeLongAt(offset: Int, value: Long)
actual inline fun Memory.storeLongAt(offset: Long, value: Long)

Write short signed 64bit integer in the network byte order (Big Endian)

Link copied to clipboard
expect fun Memory.storeShortArray(offset: Int, source: ShortArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
expect fun Memory.storeShortArray(offset: Long, source: ShortArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies short integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeShortArray(offset: Int, source: ShortArray, sourceOffset: Int, count: Int)
actual fun Memory.storeShortArray(offset: Long, source: ShortArray, sourceOffset: Int, count: Int)

Copies short integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

actual fun Memory.storeShortArray(offset: Int, source: ShortArray, sourceOffset: Int, count: Int)
actual fun Memory.storeShortArray(offset: Long, source: ShortArray, sourceOffset: Int, count: Int)

Copies short integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
expect inline fun Memory.storeShortAt(offset: Int, value: Short)
expect inline fun Memory.storeShortAt(offset: Long, value: Short)

Write short signed 16bit integer in the network byte order (Big Endian)

actual inline fun Memory.storeShortAt(offset: Int, value: Short)
actual inline fun Memory.storeShortAt(offset: Long, value: Short)

Write short signed 16bit integer in the network byte order (Big Endian)

actual inline fun Memory.storeShortAt(offset: Int, value: Short)
actual inline fun Memory.storeShortAt(offset: Long, value: Short)

Write short signed 16bit integer in the network byte order (Big Endian)

Link copied to clipboard
inline fun Memory.storeUByteArray(offset: Int, source: UByteArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
inline fun Memory.storeUByteArray(offset: Long, source: UByteArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies unsigned shorts integers from the source array at sourceOffset to this memory at the specified offset.

Link copied to clipboard
inline fun Memory.storeUIntArray(offset: Int, source: UIntArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
inline fun Memory.storeUIntArray(offset: Long, source: UIntArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies unsigned integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.storeUIntAt(offset: Int, value: UInt)
inline fun Memory.storeUIntAt(offset: Long, value: UInt)

Write regular unsigned 32bit integer in the network byte order (Big Endian)

Link copied to clipboard
inline fun Memory.storeULongArray(offset: Int, source: ULongArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
inline fun Memory.storeULongArray(offset: Long, source: ULongArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies unsigned long integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.storeULongAt(offset: Int, value: ULong)
inline fun Memory.storeULongAt(offset: Long, value: ULong)

Write short signed 64bit integer in the network byte order (Big Endian)

Link copied to clipboard
inline fun Memory.storeUShortArray(offset: Int, source: UShortArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)
inline fun Memory.storeUShortArray(offset: Long, source: UShortArray, sourceOffset: Int = 0, count: Int = source.size - sourceOffset)

Copies unsigned shorts integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian).

Link copied to clipboard
inline fun Memory.storeUShortAt(offset: Int, value: UShort)
inline fun Memory.storeUShortAt(offset: Long, value: UShort)

Write short unsigned 16bit integer in the network byte order (Big Endian)

Link copied to clipboard
expect fun <R> ByteArray.useMemory(offset: Int = 0, length: Int, block: (Memory) -> R): R

TODO KTOR-1673: Solve design problems

actual inline fun <R> ByteArray.useMemory(offset: Int, length: Int, block: (Memory) -> R): R

Execute block of code providing a temporary instance of Memory view of this byte array range starting at the specified offset and having the specified bytes length. By default, if neither offset nor length specified, the whole array is used. An instance of Memory provided into the block should be never captured and used outside of lambda.

actual inline fun <R> ByteArray.useMemory(offset: Int, length: Int, block: (Memory) -> R): R

Execute block of code providing a temporary instance of Memory view of this byte array range starting at the specified offset and having the specified bytes length. By default, if neither offset nor length specified, the whole array is used. An instance of Memory provided into the block should be never captured and used outside of lambda.

Link copied to clipboard
inline fun <R> withMemory(size: Int, block: (Memory) -> R): R
inline fun <R> withMemory(size: Long, block: (Memory) -> R): R

Invoke block function with a temporary Memory instance of the specified size in bytes. The provided instance shouldn't be captured and used outside of the block otherwise an undefined behaviour may occur including crash and/or data corruption.