fill method

void fill(
  1. List<num> data, {
  2. int offset = 0,
})

Fills an area of the memory with the given data.

This method copies all elements from data and writes the to the memory this pointer points to, beginning at the element position offset. The data must fit into the memory.

Implementation

void fill(List<num> data, {int offset = 0}) {
  final end = data.length + offset;
  if (end > count) {
    throw ArgumentError(
      'data and offset are to long. '
      'Can at most write $count elements, '
      'but requested offset=$offset + data=${data.length}',
    );
  }
  _asTypedIntListRaw().setRange(offset, end, data);
}