writeInt16 method
Writes the value
as a 2 byte long signed integer
at the current writerIndex (inclusive).
endian
the endianness of the number, defaults to kEndianness which is initialized with Endian.big.
Exceptions:
-
WriteIndexOutOfRangeException if the current writer index is outside of the bounds of the buffer
-
BufferOverflowException if the length of the resulting bytes would overflow the buffer
Implementation
void writeInt16(int value, [Endian? endian]) =>
writeByteData(2).setInt16(0, value, endian ?? kEndianness);