fill<TNum extends num> method

void fill<TNum extends num>(
  1. List<TNum> 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<TNum extends num>(List<TNum> 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}',
    );
  }
  asListView().setAll(offset, data);
}