FixedKeyNode appendLeaf(FixedKeyRecordNode leaf) throws IOException {

		// Create new leaf and link
		leaf.buffer.putInt(PREV_LEAF_ID_OFFSET, buffer.getId());
		int rightLeafBufId = buffer.getInt(NEXT_LEAF_ID_OFFSET);
		leaf.buffer.putInt(NEXT_LEAF_ID_OFFSET, rightLeafBufId);

		// Adjust this node
		int newBufId = leaf.buffer.getId();
		buffer.putInt(NEXT_LEAF_ID_OFFSET, newBufId);

		// Adjust old right node if present
		if (rightLeafBufId >= 0) {
			FixedKeyNode rightLeaf = nodeMgr.getFixedKeyNode(rightLeafBufId);
			rightLeaf.buffer.putInt(PREV_LEAF_ID_OFFSET, newBufId);
		}

		if (parent != null) {
			// Ask parent to insert new node and return root - leaf parent is unknown
			return parent.insert(newBufId, leaf.getKeyField(0));
		}

		// New parent node becomes root
		return new FixedKeyInteriorNode(nodeMgr, keyType, getKey(0), buffer.getId(), leaf.getKey(0),
			newBufId);
	}
Append a leaf which contains one or more keys and update tree.  Leaf is inserted
as the new right sibling of this leaf.
@param leaf new right sibling leaf (must be same node type as this leaf)
@return root node which may have changed.
@throws IOException thrown if an IO error occurs
Ghidra/Framework/DB/src/main/java/db/FixedKeyRecordNode.java