This commit is contained in:
22
src/commonMain/kotlin/com/infendro/bytearray/ByteOrder.kt
Normal file
22
src/commonMain/kotlin/com/infendro/bytearray/ByteOrder.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user