getInt

fun ByteArray.getInt(offset: Int, format: IntFormat, order: ByteOrder = ByteOrder.BIG_ENDIAN): Int

Returns an Int from a byte array with a given offset.

Return

Int.

Parameters

offset

The index to start from.

format

The format or the Int value to read.

order

The byte order, default is ByteOrder.BIG_ENDIAN.

Throws

If the length of byte array is less than the offset plus format length.


fun ByteArray.getInt(offset: Int, order: ByteOrder = ByteOrder.BIG_ENDIAN): Int

Returns an Int from a byte array with a given offset.

Return

Int.

Parameters

offset

The index to start from.

order

The byte order, default is ByteOrder.BIG_ENDIAN.

Throws

If the length of byte array is less than offset + 4.