private static DataTypeInstance getDtInstance(Program program, Address addr, DataType newType,
			int length, DataType realType) throws CodeUnitInsertionException {

		MemBuffer memBuf = new DumbMemBufferImpl(program.getMemory(), addr);
		DataTypeInstance dti;
		if (length > 0 && (realType instanceof Dynamic) &&
			((Dynamic) realType).canSpecifyLength()) {
			dti = DataTypeInstance.getDataTypeInstance(newType, memBuf, length, false);
		}
		else {
			dti = DataTypeInstance.getDataTypeInstance(newType, memBuf, false);
		}

		if (dti == null) {
			throw new CodeUnitInsertionException(
				"Could not create DataType " + newType.getDisplayName());
		}

		return dti;
	}
Create data where existing data may already exist.
@param program the program
@param addr data address (offcut data address only allowed if clearMode == ClearDataMode.CLEAR_ALL_CONFLICT_DATA)
@param newType new data-type being applied
@param length data length (used only for Dynamic newDataType which has canSpecifyLength()==true)
@param stackPointers see {@link #reconcileAppliedDataType(DataType, DataType, boolean)}
@param clearMode see CreateDataMode
@return new data created
@throws CodeUnitInsertionException if data creation failed
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataUtilities.java