operator []= method

void operator []=(
  1. int index,
  2. int value
)

Set the value at the given index.

The value should be in the range 0 to 255. An integer, which is not in that range, is converted to a byte as if by value.toUnsigned(8).

Implementation

void operator []=(int index, int value) {
  IndexError.check(index, length, indexable: this);
  mutableBytes.cast<Uint8>()[index] = value;
}