Little

data object Little : Endian(source)

Implementation of the Endian abstraction which performs all operations using little-endian byte order.

See also

Functions

Link copied to clipboard
open override fun intFrom(source: ByteArray, offset: Int): Int

Convert 4 bytes from source ByteArray, starting at index offset, to an Int.

Link copied to clipboard
open override fun intOf(b0: Byte, b1: Byte, b2: Byte, b3: Byte): Int

Convert 4 bytes to an Int.

Link copied to clipboard
@JvmStatic
inline fun ByteArray.leIntAt(offset: Int): Int

Syntactic Sugar. See Endian.Little.intFrom

Link copied to clipboard
@JvmStatic
inline fun ByteArray.leLongAt(offset: Int): Long

Syntactic Sugar. See Endian.Little.longFrom

Link copied to clipboard
@JvmStatic
inline fun Int.lePackInto(dest: ByteArray, destOffset: Int): ByteArray
@JvmStatic
inline fun Long.lePackInto(dest: ByteArray, destOffset: Int): ByteArray
@JvmStatic
inline fun Short.lePackInto(dest: ByteArray, destOffset: Int): ByteArray
@JvmStatic
inline fun ByteArray.lePackInto(dest: IntArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): IntArray
@JvmStatic
inline fun ByteArray.lePackInto(dest: LongArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): LongArray
@JvmStatic
inline fun ByteArray.lePackInto(dest: ShortArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ShortArray
@JvmStatic
inline fun Int.lePackInto(dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int = Int.SIZE_BYTES): ByteArray
@JvmStatic
inline fun IntArray.lePackInto(dest: ByteArray, destOffset: Int, sourceIndexStart: Int = 0, sourceIndexEnd: Int = this.size): ByteArray
@JvmStatic
inline fun Long.lePackInto(dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int = Long.SIZE_BYTES): ByteArray
@JvmStatic
inline fun LongArray.lePackInto(dest: ByteArray, destOffset: Int, sourceIndexStart: Int = 0, sourceIndexEnd: Int = this.size): ByteArray
@JvmStatic
inline fun Short.lePackInto(dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int = Short.SIZE_BYTES): ByteArray
@JvmStatic
inline fun ShortArray.lePackInto(dest: ByteArray, destOffset: Int, sourceIndexStart: Int = 0, sourceIndexEnd: Int = this.size): ByteArray

Syntactic Sugar. See Endian.Little.pack

Link copied to clipboard
@JvmStatic
inline fun Int.lePackIntoUnsafe(dest: ByteArray, destOffset: Int): ByteArray
@JvmStatic
inline fun Long.lePackIntoUnsafe(dest: ByteArray, destOffset: Int): ByteArray
@JvmStatic
inline fun Short.lePackIntoUnsafe(dest: ByteArray, destOffset: Int): ByteArray
@JvmStatic
inline fun ByteArray.lePackIntoUnsafe(dest: IntArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): IntArray
@JvmStatic
inline fun ByteArray.lePackIntoUnsafe(dest: LongArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): LongArray
@JvmStatic
inline fun ByteArray.lePackIntoUnsafe(dest: ShortArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ShortArray
@JvmStatic
inline fun Int.lePackIntoUnsafe(dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int = Int.SIZE_BYTES): ByteArray
@JvmStatic
inline fun IntArray.lePackIntoUnsafe(dest: ByteArray, destOffset: Int, sourceIndexStart: Int = 0, sourceIndexEnd: Int = this.size): ByteArray
@JvmStatic
inline fun Long.lePackIntoUnsafe(dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int = Long.SIZE_BYTES): ByteArray
@JvmStatic
inline fun LongArray.lePackIntoUnsafe(dest: ByteArray, destOffset: Int, sourceIndexStart: Int = 0, sourceIndexEnd: Int = this.size): ByteArray
@JvmStatic
inline fun Short.lePackIntoUnsafe(dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int = Short.SIZE_BYTES): ByteArray
@JvmStatic
inline fun ShortArray.lePackIntoUnsafe(dest: ByteArray, destOffset: Int, sourceIndexStart: Int = 0, sourceIndexEnd: Int = this.size): ByteArray

Syntactic Sugar. See Endian.Little.packUnsafe

Link copied to clipboard
@JvmStatic
inline fun ByteArray.leShortAt(offset: Int): Short

Syntactic Sugar. See Endian.Little.shortFrom

Link copied to clipboard
open override fun longFrom(source: ByteArray, offset: Int): Long

Convert 8 bytes from source ByteArray, starting at index offset, to a Long.

Link copied to clipboard
open override fun longOf(b0: Byte, b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte, b7: Byte): Long

Convert 8 bytes to a Long.

Link copied to clipboard
open override fun packUnsafe(source: Int, dest: ByteArray, destOffset: Int): ByteArray

Packs 4 bytes from source Int into dest ByteArray, starting at destOffset.

open override fun packUnsafe(source: Long, dest: ByteArray, destOffset: Int): ByteArray

Packs 8 bytes from source Long into dest ByteArray, starting at destOffset.

open override fun packUnsafe(source: Short, dest: ByteArray, destOffset: Int): ByteArray

Packs 2 bytes from source Short into dest ByteArray, starting at destOffset.

open override fun packUnsafe(source: ByteArray, dest: IntArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): IntArray

Packs Ints from source ByteArray (max size / 4 Ints) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest IntArray, starting at destOffset.

open override fun packUnsafe(source: ByteArray, dest: LongArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): LongArray

Packs Longs from source ByteArray (max size / 8 Longs) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest LongArray, starting at destOffset.

open override fun packUnsafe(source: ByteArray, dest: ShortArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ShortArray

Packs Shorts from source ByteArray (max size / 2 Shorts) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ShortArray, starting at destOffset.

open override fun packUnsafe(source: Int, dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ByteArray

Packs bytes from source Int (max 4 bytes) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ByteArray, starting at destOffset. If sourceIndexStart is 0 and sourceIndexEnd is Int.SIZE_BYTES, the more performant packUnsafe function will be utilized.

open override fun packUnsafe(source: IntArray, dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ByteArray

Packs bytes from source IntArray (max size * 4 bytes) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ByteArray, starting at destOffset.

open override fun packUnsafe(source: Long, dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ByteArray

Packs bytes from source Long (max 8 bytes) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ByteArray, starting at destOffset. If sourceIndexStart is 0 and sourceIndexEnd is Long.SIZE_BYTES, the more performant packUnsafe function will be utilized.

open override fun packUnsafe(source: LongArray, dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ByteArray

Packs bytes from source LongArray (max size * 8 bytes) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ByteArray, starting at destOffset.

open override fun packUnsafe(source: Short, dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ByteArray

Packs bytes from source Short (max 2 bytes) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ByteArray, starting at destOffset. If sourceIndexStart is 0 and sourceIndexEnd is Short.SIZE_BYTES, the more performant packUnsafe function will be utilized.

open override fun packUnsafe(source: ShortArray, dest: ByteArray, destOffset: Int, sourceIndexStart: Int, sourceIndexEnd: Int): ByteArray

Packs bytes from source ShortArray (max size * 2 bytes) from sourceIndexStart (inclusive) to sourceIndexEnd (exclusive) into dest ByteArray, starting at destOffset.

Link copied to clipboard
open override fun shortFrom(source: ByteArray, offset: Int): Short

Convert 2 bytes from source ByteArray, starting at index offset, to a Short.

Link copied to clipboard
open override fun shortOf(b0: Byte, b1: Byte): Short

Convert 2 bytes to a Short.