get method

Future<Uint8List> get(
  1. Tile tile
)

Returns the content of the tile. Assumes that the order of retrieval is exactly the same as the order of storage.

Implementation

Future<Uint8List> get(Tile tile) async {
  Uint8List? result = _writebufferForTiles[tile];
  if (result != null) return result;

  await writeComplete();
  if (_readbufferFile != null) {
    _TempfileIndex tempfileIndex = _indexes[tile]!;
    Readbuffer readbuffer = await _readbufferFile!.readFromFileAt(tempfileIndex.position, tempfileIndex.length);
    return readbuffer.getBuffer(0, tempfileIndex.length);
  }
  return _writebufferForTiles[tile]!;
}