All checks were successful
/ test (pull_request) Successful in 2m47s
It turns out signed math is more performant
18 lines
506 B
Kotlin
18 lines
506 B
Kotlin
package com.infendro.bytes.uint
|
|
|
|
import com.infendro.bytes.ByteOrder
|
|
import com.infendro.bytes.ByteOrder.BIG_ENDIAN
|
|
import com.infendro.bytes.int.copyInto
|
|
|
|
fun UInt.copyInto(
|
|
destination: ByteArray,
|
|
destinationOffset: Int = 0,
|
|
order: ByteOrder = BIG_ENDIAN,
|
|
) = toInt().copyInto(destination, destinationOffset, order)
|
|
|
|
fun UInt.copyInto(
|
|
destination: UByteArray,
|
|
destinationOffset: Int = 0,
|
|
order: ByteOrder = BIG_ENDIAN,
|
|
) = toInt().copyInto(destination, destinationOffset, order)
|