private void addBuffer(int index, DataBuffer buf) throws IOException {
		buf.putByte(NODE_TYPE_OFFSET, NodeMgr.CHAINED_BUFFER_DATA_NODE);
		dataBufferIdTable[index] = buf.getId();
		int indexBufferId = indexBufferIdTable[index / indexesPerBuffer];
		int indexOffset = INDEX_BASE_OFFSET + ((index % indexesPerBuffer) * ID_SIZE);
		DataBuffer indexBuffer = null;
		try {
			indexBuffer = bufferMgr.getBuffer(indexBufferId);
			indexBuffer.putInt(indexOffset, buf.getId());
			bufferMgr.releaseBuffer(indexBuffer);
		}
		finally {
			if (indexBuffer == null) {
				bufferMgr.releaseBuffer(buf);
			}
		}

	}
Add a new data buffer as an indexed buffer.
@param index buffer index.
@param buf new data buffer.
@throws IOException thrown if an IO error occurs
Ghidra/Framework/DB/src/main/java/db/ChainedBuffer.java