ktor-io / io.ktor.utils.io.bits / of

of

inline fun Memory.Companion.of(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.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.