private void encodeNameIdAttributes(Encoder encoder, DataType type) throws IOException {
		long id;
		if (type instanceof BuiltIn) {
			String nm = ((BuiltIn) type).getDecompilerDisplayName(displayLanguage);
			encoder.writeString(ATTRIB_NAME, nm);
			id = builtInDataTypes.getID(type.clone(builtInDataTypes)) | BUILTIN_ID_HEADER;
		}
		else if (type instanceof DefaultDataType) {
			encoder.writeString(ATTRIB_NAME, type.getName());
			id = DEFAULT_DECOMPILER_ID;
		}
		else {
			String name = type.getName();
			String displayName = nameTransformer.simplify(name);
			encoder.writeString(ATTRIB_NAME, type.getName());
			if (!name.equals(displayName)) {
				encoder.writeString(ATTRIB_LABEL, displayName);
			}
			id = progDataTypes.getID(type);
			if (id <= 0) {
				id = assignTemporaryId(type);
			}
		}
		encoder.writeUnsignedInteger(ATTRIB_ID, id);
	}
Encode the name and id associated with a given data-type to a stream as attributes
of the current element.
@param encoder is the stream encoder
@param type is the given data-type
@throws IOException for errors in the underlying stream
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java