putInt16Le
Writes an Int16 value to the byte array at the specified offset in little-endian order.
This function takes an integer value
and writes it as two bytes (Int16) into the byte array at the specified offset
using little-endian byte order. It also validates that the value
falls within a specified range, ensuring it can be represented as a two-byte integer.
Parameters
The offset (index) in the byte array where the Int16 value should be written. Must be within the valid range of the array's indices.
The Int16 value to be written.
The valid range for the value
. Defaults to Short.MIN_VALUE
to Short.MAX_VALUE
(i.e., -32768 to 32767). Any value outside this range will cause an exception to be thrown.
Throws
If the value
is outside the specified validRange
.
If the offset or offset
+ 1 is negative or greater than or equal to the array's size.