@Override
	boolean insertRecord(int index, DBRecord record) throws IOException {

		// Check for use of indirect chained record node(s)
		int len = record.length();
		int maxRecordLength = ((buffer.length() - HEADER_SIZE) >> 2) - entrySize; // min 4 records per node
		boolean useIndirect = (len > maxRecordLength);
		if (useIndirect) {
			len = 4;
		}

		if ((len + entrySize) > getFreeSpace())
		 {
			return false;  // insufficient space for record storage
		}

		// Make room for new record
		int offset = moveRecords(index, -len);

		// Make room for new key/offset entry
		int start = KEY_BASE_OFFSET + (index * entrySize);
		len = (keyCount - index) * entrySize;
		buffer.move(start, start + entrySize, len);

		// Store new record key/offset
		buffer.put(start, record.getKeyField().getBinaryData());
		buffer.putInt(start + keySize, offset);
		setKeyCount(keyCount + 1);

		// Store record data
		if (useIndirect) {
			ChainedBuffer chainedBuffer =
				new ChainedBuffer(record.length(), nodeMgr.getBufferMgr());
			buffer.putInt(offset, chainedBuffer.getId());
			record.write(chainedBuffer, 0);
		}
		else {
			record.write(buffer, offset);
		}
		enableIndirectStorage(index, useIndirect);

		return true;
	}
Insert the specified record at the specified key index.
Existing data may be shifted within the buffer to make room for
the new record.  Parent must be notified if this changes the leftmost
key.
@param index insertion index for stored key
@param record record to be inserted
@throws IOException thrown if an IO error occurs
Ghidra/Framework/DB/src/main/java/db/FixedKeyVarRecNode.java