public static List<FreeListPage> readPages(SqliteDataBase db, int firstFreeListPage, int numFreeListPages) {
List<FreeListPage> pages = new ArrayList<FreeListPage>(numFreeListPages);
int nextFreePage = firstFreeListPage;
for (int i = 0; i < numFreeListPages; ++i) {
ArrayDataInput block = db.getPageBlock(nextFreePage);
int nextFreePage2 = block.readInt();
block.annotateLastInt("nextFreePage", nextFreePage2);
int numEntries = block.readInt("numEntries");
List<FreePage> freePages = new ArrayList<FreePage>(numEntries);
for (int j = 0; j < numEntries; ++j) {
int freePage = block.readInt("freePage");
FreePage p = new FreePage(freePage);
db.resolvePage(freePage, p);
freePages.add(p);
}
FreeListPage p = new FreeListPage(nextFreePage, nextFreePage2, freePages);