readIntBe

fun ByteArray.readIntBe(offset: Int): Int

Reads a 32-bit signed integer in big-endian order starting at offset.

Big-endian means the most significant byte is stored at the lowest index: the byte at offset contributes bits 24..31 and the byte at offset + 3 contributes bits 0..7.

Return

the decoded value.

Parameters

offset

the index of the first byte to read.

Throws

if offset is negative or offset + 4 exceeds the array size.