void loadBook()

Load the basic info of the book. Only call this method explicitly when you want to eager load the book info. Otherwise this method will be lazy-loaded when necessary

Source

void loadBook() {
  if (_bookLoaded == true) return;

  PdbAccess access = _bible.pdbAccess;
  PdbRecord r = access.readRecord(_bookIndex);
  _indexData = r.data;

  List<PdbRecord> records = new List(_totalBookRec);
  int totalLen = 0;
  for (int i = 0; i < _totalBookRec; i++) {
    records[i] = access.readRecord(_bookIndex + i + 1);
    totalLen += records[i].data.length;
  }
  _data = new Uint8List(totalLen);
  int pos = 0;
  for (int i = 0; i < _totalBookRec; i++) {
    Uint8List data = records[i].data;
    _data.setRange(pos, pos + data.length, data);
    pos += data.length;
    access.removeFromCache(_bookIndex + i + 1);
  }

  _totalChapters = Util.readShort(_indexData, 0);
  _totalVersesAcc = new List(_totalChapters);
  int offset = 2;
  for (int i = 0; i < _totalChapters; i++) {
    _totalVersesAcc[i] = Util.readShort(_indexData, offset);
    offset += 2;
  }
  _totalChapterCharsAcc = new List(_totalChapters);
  for (int i = 0; i < _totalChapters; i++) {
    _totalChapterCharsAcc[i] = Util.readInt(_indexData, offset);
    offset += 4;
  }
  _totalVerseCharsAcc = new List(((_indexData.length - offset) / 2).floor());
  for (int i = 0; offset < _indexData.length; i++) {
    _totalVerseCharsAcc[i] = Util.readShort(_indexData, offset);
    offset += 2;
  }

  _bookLoaded = true;
}