writeFloatListFunc method Null safety

void writeFloatListFunc(
  1. Pointer<Void> pointersVector,
  2. Pointer<Float> elements,
  3. int elementsCount
)

Implementation

static void writeFloatListFunc(
    Pointer<Void> pointersVector,
    Pointer<Float> elements,
    int elementsCount
    )
{
  PointerBuffer buffer = PointerBuffer<Float>.fromPointer(pointersVector);
  buffer.setSize(elementsCount);

  Float32List streamDataPtr = buffer.dataPtr<Float>().asTypedList(elementsCount);

  Pointer<Float> castPointer = elements.cast();
  Float32List dataPtr = castPointer.asTypedList(elementsCount);

  streamDataPtr.setAll(0, dataPtr);
}