@Override
	public synchronized void close() throws IOException {

		if (isClosed())
			return;

		stopPreSave(true);

		if (versionFileHandler != null) {
			versionFileHandler.close();
		}

		boolean comit = false;
		try {
			comit = flush(); // commt if raf != null && !readOnly && !temporary
			if (comit) {
				if (versionOutFile != null) {
					versionOutFile.close();
					versionOutFile = null;
				}
				if (changeMap != null) {
					changeMap.close();
					changeMap = null;
				}
			}
			super.close();
			// NOTE: the above close will delete non-read-only files which were not committed
		}
		finally {
			if (bfMgr != null) {
				if (comit) {
					bfMgr.versionCreated(version, comment, checkinId);
				}
				if (!isReadOnly() || saveFile != null) {
					bfMgr.updateEnded(checkinId);
				}
			}
			if (versionOutFile != null) {
				versionOutFile.abort();
			}
			if (changeMap != null) {
				changeMap.abort();
			}
			disposeSaveFiles();
		}
	}
Output old data for a specified buffer if required for version file.
@param index buffer index
@throws IOException
Ghidra/Framework/DB/src/main/java/db/buffers/LocalManagedBufferFile.java