readBytes method

Uint8List readBytes(
  1. int ptr,
  2. int len
)

Copies len bytes at ptr out of the module heap.

Implementation

Uint8List readBytes(int ptr, int len) {
  if (len == 0) return Uint8List(0);
  final heap = module.heapU8;
  return (heap.callMethod('slice'.toJS, ptr.toJS, (ptr + len).toJS) as JSUint8Array).toDart;
}