Int24

value class Int24(val value: Int) : Comparable<Int24>

A 24-bit representation of a (signed) Integer

Constructors

Link copied to clipboard
constructor(value: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val value: Int

the Int value this Integer represents. Must be between Int24.MIN_VALUE and Int24.MAX_VALUE

Functions

Link copied to clipboard
infix fun Int24.and(other: Int24): Int24

Performs a bitwise AND operation between the two values.

Link copied to clipboard
open operator override fun compareTo(other: Int24): Int
Link copied to clipboard
fun Int24.copyIntoByteArray(array: ByteArray, offset: Int = 0, byteOrder: ByteOrder): ByteArray

Encodes this Int24 and copies it into a ByteArray at a given offset.

Link copied to clipboard
operator fun div(other: Int24): Int24
Link copied to clipboard

Checks whether the bit at index is set in this Int24

Link copied to clipboard
operator fun minus(other: Int24): Int24
Link copied to clipboard
infix fun Int24.or(other: Int24): Int24

Performs a bitwise OR operation between the two values.

Link copied to clipboard
operator fun plus(other: Int24): Int24
Link copied to clipboard
fun Int24.setBit(index: Number): Int24

Creates a Int24 that is equal to this Int24 except the bit at index is set

Link copied to clipboard
infix fun Int24.shl(bitCount: Int): Int24

Shifts this value left by the bitCount number of bits.

Link copied to clipboard
infix fun Int24.shr(bitCount: Int): Int24

Shifts this value right by the bitCount number of bits.

Link copied to clipboard
operator fun times(other: Int24): Int24
Link copied to clipboard

Encodes this Int24 into a ByteArray.

Link copied to clipboard

Converts this Int24 value to UInt24. If this value is positive, the resulting UInt24 value represents the same numerical value as this Int24. The resulting UInt24 value has the same binary representation as this Int24 value.