ktor-io / io.ktor.utils.io.bits / copyTo

copyTo

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

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

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

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(destination: ByteBuffer, offset: Long): Unit

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