public static StringDataInstance getStringDataInstance(DataType dataType, MemBuffer buf,
			Settings settings, int length) {
		if (dataType instanceof AbstractStringDataType asdt) {
			return asdt.getStringDataInstance(buf, settings, length);
		}
		boolean isArray = dataType instanceof Array;
		if (isArray) {
			dataType = ArrayStringable.getArrayStringable(((Array) dataType).getDataType());
		}
		if (dataType instanceof ArrayStringable arrayStringable &&
			arrayStringable.hasStringValue(settings) && buf.isInitializedMemory()) {

			// this could be either a charsequence or an array of char elements
			return new StringDataInstance(dataType, settings, buf, length, isArray);
		}
		return NULL_INSTANCE;
	}
Returns a new {@link StringDataInstance} using the bytes in the MemBuffer.

@param dataType {@link DataType} of the bytes in the buffer.
@param buf memory buffer containing the bytes.
@param settings the Settings object
@param length the length of the data.
@return new {@link StringDataInstance}, never NULL. See {@link #NULL_INSTANCE}.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java