public DataBuffer createBuffer() throws IOException {
		synchronized (snapshotLock) {
			synchronized (this) {

				if (corruptedState) {
					throw new IOException("Corrupted BufferMgr state");
				}

				int id = indexProvider.allocateIndex();
				DataBuffer buf = null;
				BufferNode node = getCachedBufferNode(id);
				if (node != null) {
					buf = node.buffer;
					node.locked = true;
					removeFromCache(node);
				}

				buf = buf != null ? buf : getCacheBuffer();
				buf.setId(id);
				buf.setDirty(true);
				buf.setEmpty(false);

				++lockCount;
				return buf;
			}
		}
	}
Get a new or recycled buffer.
New buffer is always returned with update enabled.
When done working with the buffer, the method releaseBuffer
must be used to return it to the buffer manager.  Buffers
should not be held for long periods.
@return buffer object, or null if buffer not found
@throws IOException if a cache file access error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/BufferMgr.java