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

commonMain.kotlinx.io.bits.ByteOrder.kt Maven / Gradle / Ivy

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

/**
 * Reverse number's byte order
 */
expect fun Short.reverseByteOrder(): Short

/**
 * Reverse number's byte order
 */
expect fun Int.reverseByteOrder(): Int

/**
 * Reverse number's byte order
 */
expect fun Long.reverseByteOrder(): Long

/**
 * Reverse number's byte order
 */
expect fun Float.reverseByteOrder(): Float

/**
 * Reverse number's byte order
 */
expect fun Double.reverseByteOrder(): Double

/**
 * Reverse number's byte order
 */
@ExperimentalUnsignedTypes
fun UShort.reverseByteOrder(): UShort = toShort().reverseByteOrder().toUShort()

/**
 * Reverse number's byte order
 */
@ExperimentalUnsignedTypes
fun UInt.reverseByteOrder(): UInt = toInt().reverseByteOrder().toUInt()

/**
 * Reverse number's byte order
 */
@ExperimentalUnsignedTypes
fun ULong.reverseByteOrder(): ULong = toLong().reverseByteOrder().toULong()






© 2015 - 2025 Weber Informatics LLC | Privacy Policy