Files
bytes.kt/src/commonMain/kotlin/com/infendro/bytearray/ByteOrder.kt
Infendro ded3b31aa4
All checks were successful
/ publish (push) Successful in 2m39s
initial commit
2025-07-24 20:24:17 +02:00

23 lines
445 B
Kotlin

package com.infendro.bytearray
enum class ByteOrder {
BIG_ENDIAN {
override fun normalize(
bytes: ByteArray,
): ByteArray {
return bytes
}
},
LITTLE_ENDIAN {
override fun normalize(
bytes: ByteArray,
): ByteArray {
return bytes.reversedArray()
}
};
internal abstract fun normalize(
bytes: ByteArray,
): ByteArray
}