private void readFreeIndexList(int listIndex, int size) throws IOException {

		freeIndexes = new int[size];
		
		int maxOffset = bufferSize - FREE_LIST_ENTRY_SIZE;
		
		DataBuffer listBuffer = new DataBuffer();
		versionFile.get(listBuffer, listIndex);
		if (listBuffer.isEmpty()) {
			throw new IOException(BAD_FREE_LIST);	
		}
		int offset = FIRST_ENTRY_OFFSET;
		int entryIx = 0;
		
		while (true) {
			if (offset > maxOffset) {
				// Get next list buffer
				listIndex = listBuffer.getInt(NEXT_BUFFER_INDEX_OFFSET);
				versionFile.get(listBuffer, listIndex);
				if (listBuffer.isEmpty()) {
					throw new IOException(BAD_FREE_LIST);	
				}
				offset = FIRST_ENTRY_OFFSET;
			}
	
			// Read entry - end of list signified by -1
			int origIndex = listBuffer.getInt(offset);
			if (origIndex < 0) {
				break;
			}
			if (entryIx == size) {
				throw new IOException(BAD_FREE_LIST);
			}
			offset += 4;
			freeIndexes[entryIx++] = origIndex;
		}
		if (entryIx != size) {
			throw new IOException(BAD_FREE_LIST);
		}
		Arrays.sort(freeIndexes);
	}
Reopen version file as read-only
@throws IOException
Ghidra/Framework/DB/src/main/java/db/buffers/VersionFile.java