byteArrayToUnsignedInt

open fun byteArrayToUnsignedInt(data: @NotNull Array<Byte>): Int

Converts a byte array to an unsigned integer.

Parses the first four bytes of data (big endian) as an unsigned int.

Return

The unsigned integer.

Parameters

data

the byte array.


open fun byteArrayToUnsignedInt(data: @NotNull Array<Byte>, offset: Int): Int

Converts a byte array to an unsigned integer.

Parses the first four bytes of data (big endian) from the offset as an unsigned integer.

Return

The unsigned integer.

Parameters

data

the byte array.

offset

the offset to start parsing the int.


open fun byteArrayToUnsignedInt(data: @NotNull Array<Byte>, offset: Int, @Nullable endian: @Nullable Endian): Int

Converts a byte array to an unsigned integer.

Parses the next four bytes of data (big endian) from the offset as an unsigned integer.

Return

The unsigned integer.

Parameters

data

the byte array

offset

the offset to start parsing the int

endian

the endianness of the data. (LITTLE or BIG). If null, BIG is assumed


open fun byteArrayToUnsignedInt(data: @NotNull Array<Byte>, offset: Int, @Nullable endian: @Nullable Endian, length: Int): Int

Converts a byte array to an unsigned integer.

Return

The unsigned integer.

Parameters

data

the byte array.

offset

the offset to start parsing the int.

endian

the endianness of the data. (LITTLE or BIG). If null, BIG is assumed

length

the number of bytes to convert to an int. This number must be between 0 and 4.