decodeUInt40

fun ByteArray.decodeUInt40(octetIndex: Int, byteOrder: ByteOrder): UInt40

Decodes a ByteArray into an UInt40 using the 5 bytes starting from octetIndex

Return

the decoded UInt40

Parameters

octetIndex

the the index of the octet start the decoding from. Must be be at most the fifth to last octet

byteOrder

the ByteOrder in which the UInt40 is encoded

Throws

if octetIndex or its next four octets are not available in the ByteArray