setUint8 method
Writes an unsigned integer to 1-byte.
If value falls outside the range 0 : 255 (inclusive), the integer is overflow (e.g.
-2 -> [254], -1 -> [255], ..., 256 -> [0] and 257 -> [1]).
The offset must satisy the relations 0 ≤ offset ≤ offset+1 ≤ this.length.
final Buffer buffer = Buffer(1);
buffer.setUint8(128, 0);
print(buffer); // [128]
Implementation
void setUint8(final int value, final int offset) {
return asByteData().setUint8(offset, value);
}