setUint8 method

void setUint8(
  1. int value,
  2. int offset
)

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 0offsetoffset+1this.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);
}