private void unloadCachedNode(BufferNode node) throws IOException {

// ?? Should not happen
		if (node.buffer == null) {
			throw new AssertException();
		}

		// Ensure that old node is retained in disk cache
		if (node.diskCacheIndex < 0) {
			node.diskCacheIndex = cacheIndexProvider.allocateIndex();
			cacheFile.put(node.buffer, node.diskCacheIndex);
		}
		else if (node.isDirty) {
			// Overwrite if node is dirty
			cacheFile.put(node.buffer, node.diskCacheIndex);
		}
		node.isDirty = false;
	}
Unload buffer from memory cache to disk cache if needed.
@param node buffer node to be unloaded from memory cache.
@throws IOException if a cache file access error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/BufferMgr.java