private void readBufferMap() throws NoSuchElementException, IOException {

		mapIndex = recoveryFile.getParameter(MAP_BUFFER_INDEX_PARM);

		int maxOffset = (recoveryFile.getBufferSize() - 8) & ~0x07;

		int thisIndex = mapIndex;
		DataBuffer mapBuffer = new DataBuffer();
		recoveryFile.get(mapBuffer, thisIndex);
		if (mapBuffer.isEmpty()) {
			throw new IOException(BAD_BUFFER_MAP);
		}

		int nextMapEntryOffset = FIRST_ENTRY_OFFSET;

		while (true) {
			if (nextMapEntryOffset > maxOffset) {
				// Get next map buffer
				thisIndex = mapBuffer.getInt(NEXT_BUFFER_INDEX_OFFSET);
				recoveryFile.get(mapBuffer, thisIndex);
				if (mapBuffer.isEmpty()) {
					throw new IOException(BAD_BUFFER_MAP);
				}
				nextMapEntryOffset = FIRST_ENTRY_OFFSET;
			}

			// Read map entry - end of list signified by -1
			int realIndex = mapBuffer.getInt(nextMapEntryOffset);
			if (realIndex < 0) {
				return;
			}
			nextMapEntryOffset += 4;
			int recoveryIndex = mapBuffer.getInt(nextMapEntryOffset);
			nextMapEntryOffset += 4;
			bufferIndexMap.put(realIndex, recoveryIndex);
		}
	}
Construct a read-only recovery file
@param srcBf the original source buffer file to which this file applies.
@param rfile version buffer file to be updated/created
@throws IOException if the file already exists or an IO error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/RecoveryFile.java