decodeUShort

fun ByteArray.decodeUShort(octetIndex: Int, byteOrder: ByteOrder): UShort

Converts ByteArray to UShort

Return

the decoded UShort

Parameters

octetIndex

index of byte to start. Must not be higher than the second to last octet.

byteOrder

ByteOrder to use for decoding.

Throws

if octetIndex is bigger than the size of the ByteArray minus 2.