uint8ListToPointerInt8 function

Pointer<Int8> uint8ListToPointerInt8(
  1. Uint8List units, {
  2. Allocator allocator = calloc,
})

Implementation

Pointer<Int8> uint8ListToPointerInt8(Uint8List units,
    {Allocator allocator = calloc}) {
  final pointer = allocator<Uint8>(units.length + 1); //blob
  final nativeString = pointer.asTypedList(units.length + 1); //blobBytes
  nativeString.setAll(0, units);
  nativeString[units.length] = 0;
  return pointer.cast();
}