23 lines
445 B
Kotlin
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
|
|
}
|