setUint method

int setUint(
  1. int value,
  2. int offset,
  3. int length, [
  4. Endian endian = Endian.little,
])

Writes an unsigned integer to a region of the buffer.

The value is written to the range [offset : offset+length].

The range must satisy the relations 0offsetoffset+lengththis.length.

Returns the position of the last element written to the buffer ([offset]+[length]).

final Buffer buffer = Buffer(3);
buffer.setUint(4950584, 0, 3);
print(buffer); // [56, 138, 75]

Implementation

int setUint(
  final int value,
  final int offset,
  final int length, [
  final Endian endian = Endian.little,
]) {
  assert(value >= 0, 'The [int] value $value must be a positive integer.');
  return setInt(value, offset, length, endian);
}