MemoryStorageBackend.fromBytes constructor

MemoryStorageBackend.fromBytes(
  1. Uint8List bytes, {
  2. bool trackDurability = false,
})

Creates a MemoryStorageBackend initialized with a copy of bytes.

Implementation

MemoryStorageBackend.fromBytes(
  Uint8List bytes, {
  this.trackDurability = false,
}) : _buffer = Uint8List(bytes.length < 64 ? 64 : bytes.length)
       ..setRange(0, bytes.length, bytes),
     _length = bytes.length,
     _durable = trackDurability ? Uint8List.fromList(bytes) : null;