fromPointer static method

Uint8List fromPointer(
  1. Pointer<Uint8> ptr,
  2. int length
)

Implementation

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