Package-level declarations

Functions

Link copied to clipboard

Returns a ByteArray containing the target value.

fun Int.getBytes(be: Boolean = true): ByteArray

Returns a ByteArray containing the 4 bytes that make up the target Int value.

fun Long.getBytes(be: Boolean = true): ByteArray

Returns a ByteArray containing the 8 bytes that make up the target Long value.

fun Short.getBytes(be: Boolean = true): ByteArray

Returns a ByteArray containing the 2 bytes that make up the target Short value.

fun UInt.getBytes(be: Boolean = true): ByteArray

Returns a ByteArray containing the 4 bytes that make up the target UInt value.

fun ULong.getBytes(be: Boolean = true): ByteArray

Returns a ByteArray containing the 8 bytes that make up the target ULong value.

fun UShort.getBytes(be: Boolean = true): ByteArray

Returns a ByteArray containing the 2 bytes that make up the target UShort value.

fun Byte.getBytes(buffer: ByteArray, offset: Int = 0): Int
fun UByte.getBytes(buffer: ByteArray, offset: Int = 0): Int

Fills the given buffer, starting from the given offset, with the target value.

fun Int.getBytes(buffer: ByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 4 bytes that make up the target Int value.

fun Long.getBytes(buffer: ByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 8 bytes that make up the target Long value.

fun Short.getBytes(buffer: ByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 2 bytes that make up the target Short value.

fun UInt.getBytes(buffer: ByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 4 bytes that make up the target UInt value.

fun ULong.getBytes(buffer: ByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 8 bytes that make up the target ULong value.

fun UShort.getBytes(buffer: ByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 2 bytes that make up the target UShort value.

Link copied to clipboard

Returns a UByteArray containing the target value.

fun Int.getUBytes(be: Boolean = true): UByteArray

Returns a UByteArray containing the 4 unsigned bytes that make up the target Int value.

fun Long.getUBytes(be: Boolean = true): UByteArray

Returns a UByteArray containing the 8 unsigned bytes that make up the target Long value.

Returns a UByteArray containing the 2 unsigned bytes that make up the target Short value.

fun UInt.getUBytes(be: Boolean = true): UByteArray

Returns a UByteArray containing the 4 unsigned bytes that make up the target UInt value.

Returns a UByteArray containing the 8 unsigned bytes that make up the target ULong value.

Returns a UByteArray containing the 2 unsigned bytes that make up the target UShort value.

fun Byte.getUBytes(buffer: UByteArray, offset: Int = 0): Int
fun UByte.getUBytes(buffer: UByteArray, offset: Int = 0): Int

Fills the given buffer, starting from the given offset, with the target value.

fun Int.getUBytes(buffer: UByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 4 bytes that make up the target Int value.

fun Long.getUBytes(buffer: UByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 8 bytes that make up the target Long value.

fun Short.getUBytes(buffer: UByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 2 bytes that make up the target Short value.

fun UInt.getUBytes(buffer: UByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 4 bytes that make up the target UInt value.

fun ULong.getUBytes(buffer: UByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 8 bytes that make up the target ULong value.

fun UShort.getUBytes(buffer: UByteArray, offset: Int = 0, be: Boolean = true): Int

Fills the given buffer, starting from the given offset, with the 2 bytes that make up the target UShort value.