read method

List<int> read(
  1. int offset,
  2. int len
)

Reads an byte array from mapped physical memory, starting at the specified byte offset, relative to the base address the MMIO handle was opened with.

Implementation

List<int> read(int offset, int len) {
  var buf = malloc<Uint8>(len);
  try {
    _checkError(_nativeMMIOreadBuf(_mmioHandle, offset, buf, len));
    var data = <int>[];
    for (var i = 0; i < len; ++i) {
      data.add(buf[i]);
    }
    return data;
  } finally {
    malloc.free(buf);
  }
}