convertUint8ListToPointer function

Pointer<Uint8> convertUint8ListToPointer(
  1. Uint8List data
)

Implementation

Pointer<Uint8> convertUint8ListToPointer(Uint8List data) {
  int length = data.length;
  Pointer<Uint8> dataPtr = calloc<Uint8>(length);

  for (int i = 0; i < length; i++) {
    dataPtr.elementAt(i).value = data[i];
  }

  return dataPtr;
}