writeByteListFunc method Null safety

void writeByteListFunc(
  1. Pointer<Void> stream,
  2. Pointer<Uint8> data,
  3. int bytesCount
)

Implementation

static void writeByteListFunc(Pointer<Void> stream, Pointer<Uint8> data, int bytesCount) {
  PointerBuffer buffer = PointerBuffer<Float>.fromPointer(stream);
  buffer.setSize(bytesCount);
  Uint8List streamDataPtr = buffer.dataPtr<Uint8>().asTypedList(bytesCount);

  Uint8List dataList = data.asTypedList(bytesCount);

  streamDataPtr.setAll(0, dataList);
}