static FileBytesAdapter getAdapter(DBHandle handle, OpenMode openMode, TaskMonitor monitor)
			throws VersionException, IOException {

		if (openMode == OpenMode.CREATE) {
			return new FileBytesAdapterV0(handle, true);
		}
		try {
			return new FileBytesAdapterV0(handle, false);
		}
		catch (VersionException e) {
			if (!e.isUpgradable() || openMode == OpenMode.UPDATE) {
				throw e;
			}
			FileBytesAdapter adapter = findReadOnlyAdapter(handle);
			if (openMode == OpenMode.UPGRADE) {
				adapter = upgrade(handle, adapter, monitor);
			}
			return adapter;
		}

	}
Database Adapter for storing and retrieving original file bytes.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/mem/FileBytesAdapter.java