getShort

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

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

Return

Short.

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 + Short.SIZE_BYTES.