writeShortLe

fun ByteArray.writeShortLe(offset: Int, value: Short)

Writes a 16-bit signed integer in little-endian order starting at offset.

The least significant byte of value is stored at offset and the most significant byte at offset + 1. The array is modified in place and no other indices are touched.

Parameters

offset

the index of the first byte to write.

value

the value to encode.

Throws

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