private static void refreshDatabase(BufferFileManager bfMgr, long checkinId,
			ResourceFile packedFile, TaskMonitor monitor) throws IOException, CancelledException {
		if (monitor == null) {
			monitor = TaskMonitor.DUMMY;
		}
		int version = bfMgr.getCurrentVersion() + 1; // should be 1 in most situations
		File file = bfMgr.getBufferFile(version);
		OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
		ItemDeserializer itemDeserializer = null;
		try {
			Msg.debug(PackedDatabase.class, "Unpacking database " + packedFile + " -> " + file);
			itemDeserializer = new ItemDeserializer(packedFile);
			itemDeserializer.saveItem(out, monitor);
			bfMgr.versionCreated(version, "Unpacked " + packedFile, checkinId);
		}
		catch (IOCancelledException e) {
			throw new CancelledException();
		}
		finally {
			if (itemDeserializer != null) {
				itemDeserializer.dispose();
			}
			try {
				out.close();
			}
			catch (IOException e) {
				// ignore
			}
		}
	}
Create a new Database with data provided by an ItemDeserializer.
@param bfMgr the buffer manager for the database
@param checkinId the check-in id
@param packedFile the file to unpack
@param monitor the task monitor
@throws IOException if IO error occurs
@throws CancelledException if unpack is cancelled
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/db/PackedDatabase.java