fromPointer static method

Uint8List fromPointer(
  1. Pointer<Uint8> ptr,
  2. int length, {
  3. bool copy = true,
})

Implementation

static Uint8List fromPointer(Pointer<Uint8> ptr, int length,
    {bool copy: true}) {
  final view = ptr.asTypedList(length);
  final builder = BytesBuilder(copy: copy);
  builder.add(view);
  return builder.takeBytes();
}