Big

data object Big : Endian(source)

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

See also

Functions

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

Syntactic Sugar. See Endian.Big.intFrom

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

Syntactic Sugar. See Endian.Big.longFrom

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

Syntactic Sugar. See Endian.Big.pack

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

Syntactic Sugar. See Endian.Big.packUnsafe

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

Syntactic Sugar. See Endian.Big.shortFrom

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
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.