@Override
	public synchronized boolean setReadOnly() throws IOException {

		if (!flush()) {
			return false;
		}

		raf.close();
		raf = new RandomAccessFile(file, "r");
		readOnly = true;

		return true;
	}
Write all unwritten data to the file prior to closing.
@return true if flush was performed, false if not required.
@throws IOException thrown if flush failed
Ghidra/Framework/DB/src/main/java/db/buffers/LocalBufferFile.java