implement optimizations
This commit is contained in:
33
src/commonMain/kotlin/com/infendro/bytes/long/Copy.kt
Normal file
33
src/commonMain/kotlin/com/infendro/bytes/long/Copy.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.infendro.bytes.long
|
||||
|
||||
import com.infendro.bytes.ByteOrder
|
||||
import com.infendro.bytes.ByteOrder.BIG_ENDIAN
|
||||
import com.infendro.bytes.ulong.copyInto
|
||||
|
||||
fun Long.copyInto(
|
||||
destination: UByteArray,
|
||||
destinationOffset: Int = 0,
|
||||
order: ByteOrder = BIG_ENDIAN,
|
||||
) = toULong().copyInto(destination, destinationOffset, order)
|
||||
|
||||
fun Long.copyInto(
|
||||
destination: ByteArray,
|
||||
destinationOffset: Int = 0,
|
||||
order: ByteOrder = BIG_ENDIAN,
|
||||
) = toULong().copyInto(destination, destinationOffset, order)
|
||||
|
||||
fun LongArray.copyInto(
|
||||
destination: UByteArray,
|
||||
destinationOffset: Int = 0,
|
||||
startIndex: Int = 0,
|
||||
endIndex: Int = size,
|
||||
order: ByteOrder = BIG_ENDIAN,
|
||||
) = asULongArray().copyInto(destination, destinationOffset, startIndex, endIndex, order)
|
||||
|
||||
fun LongArray.copyInto(
|
||||
destination: ByteArray,
|
||||
destinationOffset: Int = 0,
|
||||
startIndex: Int = 0,
|
||||
endIndex: Int = size,
|
||||
order: ByteOrder = BIG_ENDIAN,
|
||||
) = asULongArray().copyInto(destination, destinationOffset, startIndex, endIndex, order)
|
||||
Reference in New Issue
Block a user