All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlinx.io.core.ByteOrderJVM.kt Maven / Gradle / Ivy

There is a newer version: 0.1.16
Show newest version
package kotlinx.io.core

actual enum class ByteOrder(val nioOrder: java.nio.ByteOrder) {
    BIG_ENDIAN(java.nio.ByteOrder.BIG_ENDIAN),
    LITTLE_ENDIAN(java.nio.ByteOrder.LITTLE_ENDIAN);

    actual companion object {
        private val native: ByteOrder = orderOf(java.nio.ByteOrder.nativeOrder())
        fun of(nioOrder: java.nio.ByteOrder): ByteOrder = orderOf(nioOrder)

        actual fun nativeOrder(): ByteOrder = native
    }
}

private fun orderOf(nioOrder: java.nio.ByteOrder): ByteOrder = if (nioOrder === java.nio.ByteOrder.BIG_ENDIAN) ByteOrder.BIG_ENDIAN else ByteOrder.LITTLE_ENDIAN




© 2015 - 2025 Weber Informatics LLC | Privacy Policy