Google is committed to advancing racial equity for Black communities. See how.

SizedVmo.fromUint8List constructor

SizedVmo.fromUint8List(Uint8List bytes)

Constructs a VMO using the given bytes. The returned Vmo is read-only.

Implementation

factory SizedVmo.fromUint8List(Uint8List bytes) {
  HandleResult r = System.vmoCreate(bytes.length);
  if (r.status != ZX.OK) {
    throw ZxStatusException(r.status, getStringForStatus(r.status));
  }
  return SizedVmo(r.handle, bytes.length)
    ..write(bytes.buffer.asByteData());
}