public boolean addIndividualComponentsToStructure(Structure structure, Structure structureToAdd,
			int startOffset, int dataLength) throws CancelledException {

		// this check does not allow growing of structure. It only allows adding to the structure if
		// the block of components to add will fit at the given offset
		if (!EditStructureUtils.canAdd(structure, startOffset, dataLength, false, monitor)) {
			return false;
		}

		for (DataTypeComponent dataTypeComponent : structureToAdd.getDefinedComponents()) {

			monitor.checkCancelled();

			// only copy the components up to the given total dataLength to copy
			if ((dataTypeComponent.getOffset() + dataTypeComponent.getLength()) > dataLength) {
				break;
			}

			structure.replaceAtOffset(startOffset + dataTypeComponent.getOffset(),
				dataTypeComponent.getDataType(), -1, dataTypeComponent.getFieldName(),
				dataTypeComponent.getComment());
		}
		return true;
	}
Method to add the structure components from the given structureToAdd from the given starting
offset to the given ending offset of the  to the given structure at the given offset
@param structure the structure to add to
@param structureToAdd the structure to add a subset of components from to the given structure
@param startOffset the starting offset of where to start adding in the container structure
@param dataLength the total length of the data components to add
@return true if the structure was updated or false if the components cannot be added
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java