getUShort

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

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

Return

UShort.

Parameters

offset

The index to start from.

order

The byte order, default is ByteOrder.BIG_ENDIAN.

Throws

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