remove unsigned support

This commit is contained in:
2026-02-04 18:19:50 +01:00
parent 421beeed1e
commit 03ec68cc40
36 changed files with 286 additions and 874 deletions

View File

@@ -3,8 +3,8 @@ package com.infendro.bytes.int
import com.infendro.bytes.ByteOrder
import com.infendro.bytes.ByteOrder.BIG_ENDIAN
fun Int.toByteArray(order: ByteOrder = BIG_ENDIAN): ByteArray =
ByteArray(4).also { copyInto(it, order = order) }
fun Int.toUByteArray(order: ByteOrder = BIG_ENDIAN): UByteArray =
UByteArray(4).also { copyInto(it, order = order) }
fun Int.toByteArray(order: ByteOrder = BIG_ENDIAN): ByteArray {
val result = ByteArray(4)
copyInto(result, order = order)
return result
}