Package io.ktor.utils.io.bits
Types
expect 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. |
Extensions for External Classes
Functions
expect fun Memory.copyTo( expect fun Memory.copyTo( Copies bytes from this memory range from the specified offset and length to the destination at destinationOffset. fun Memory.copyTo(destination: ByteBuffer, offset: Int): Unit fun Memory.copyTo( Copies bytes from this memory range from the specified offset to the destination buffer. |
|
Fill memory range starting at the specified offset with value repeated count times. |
|
Read byte at the specified index. |
|
fun Memory.loadByteArray( Copies bytes from this memory range from the specified offset and count to the destination at destinationOffset. fun Memory.loadByteArray( 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). |
|
expect fun Memory.loadDoubleArray( expect fun Memory.loadDoubleArray( 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). |
|
Read short signed 64bit floating point number in the network byte order (Big Endian) |
|
expect fun Memory.loadFloatArray( expect fun Memory.loadFloatArray( 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). |
|
Read short signed 32bit floating point number in the network byte order (Big Endian) |
|
expect fun Memory.loadIntArray( expect fun Memory.loadIntArray( 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). |
|
Read regular signed 32bit integer in the network byte order (Big Endian) |
|
expect fun Memory.loadLongArray( expect fun Memory.loadLongArray( 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). |
|
Read short signed 64bit integer in the network byte order (Big Endian) |
|
expect fun Memory.loadShortArray( expect fun Memory.loadShortArray( Copies 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). |
|
Read short signed 16bit integer in the network byte order (Big Endian) |
|
fun Memory.loadUByteArray( fun Memory.loadUByteArray( 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). |
|
fun Memory.loadUIntArray( fun Memory.loadUIntArray( 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). |
|
Read regular unsigned 32bit integer in the network byte order (Big Endian) |
|
fun Memory.loadULongArray( fun Memory.loadULongArray( 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). |
|
Read short signed 64bit integer in the network byte order (Big Endian) |
|
fun Memory.loadUShortArray( fun Memory.loadUShortArray( 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). |
|
Read short unsigned 16bit integer in the network byte order (Big Endian) |
|
fun <ERROR CLASS>.reverseByteOrder(): <ERROR CLASS> Reverse number’s byte order |
|
fun Memory.storeByteArray( fun Memory.storeByteArray( Copies unsigned shorts integers from the source array at sourceOffset to this memory at the specified offset. |
|
expect fun Memory.storeDoubleArray( expect fun Memory.storeDoubleArray( 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). |
|
Write short signed 64bit floating point number in the network byte order (Big Endian) |
|
expect fun Memory.storeFloatArray( expect fun Memory.storeFloatArray( 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). |
|
Write short signed 32bit floating point number in the network byte order (Big Endian) |
|
expect fun Memory.storeIntArray( expect fun Memory.storeIntArray( Copies regular integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian). |
|
Write regular signed 32bit integer in the network byte order (Big Endian) |
|
expect fun Memory.storeLongArray( expect fun Memory.storeLongArray( Copies long integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian). |
|
Write short signed 64bit integer in the network byte order (Big Endian) write short signed 64bit integer in the network byte order (Big Endian) |
|
expect fun Memory.storeShortArray( expect fun Memory.storeShortArray( Copies shorts integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian). |
|
Write short signed 16bit integer in the network byte order (Big Endian) |
|
fun Memory.storeUByteArray( fun Memory.storeUByteArray( Copies unsigned shorts integers from the source array at sourceOffset to this memory at the specified offset. |
|
fun Memory.storeUIntArray( fun Memory.storeUIntArray( Copies unsigned integers from the source array at sourceOffset to this memory at the specified offset interpreting numbers in the network order (Big Endian). |
|
Write regular unsigned 32bit integer in the network byte order (Big Endian) |
|
fun Memory.storeULongArray( fun Memory.storeULongArray( 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). |
|
Write short signed 64bit integer in the network byte order (Big Endian) |
|
fun Memory.storeUShortArray( fun Memory.storeUShortArray( 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). |
|
Write short unsigned 16bit integer in the network byte order (Big Endian) |
|
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. |
Companion Object Functions
fun Memory.Companion.of( Create Memory view for the specified array range starting at offset and the specified bytes length. fun Memory.Companion.of(buffer: ByteBuffer): Memory Create Memory view for the specified buffer range starting at ByteBuffer.position and ending at ByteBuffer.limit. Changing the original buffer’s position/limit will not affect previously created Memory instances. |