setUint16 method
Writes an unsigned integer to 2-bytes.
The offset must satisy the relations 0 ≤ offset ≤ offset+2 ≤ this.length.
final Buffer buffer = Buffer(2);
buffer.setUint16(27231, 0);
print(buffer); // [95, 106]
Implementation
void setUint16(final int value, final int offset, [final Endian endian = Endian.little]) {
return asByteData().setUint16(offset, value, endian);
}