private void encodeEnum(Encoder encoder, Enum type, int size) throws IOException {
		encoder.openElement(ELEM_TYPE);
		encodeNameIdAttributes(encoder, type);
		String metatype = type.isSigned() ? "enum_int" : "enum_uint";
		String[] names = type.getNames();
		encoder.writeString(ATTRIB_METATYPE, metatype);
		encoder.writeSignedInteger(ATTRIB_SIZE, type.getLength());
		for (String name : names) {
			encoder.openElement(ELEM_VAL);
			encoder.writeString(ATTRIB_NAME, name);
			encoder.writeSignedInteger(ATTRIB_VALUE, type.getValue(name));
			encoder.closeElement(ELEM_VAL);
		}
		encoder.closeElement(ELEM_TYPE);
	}
Encode an Enum data-type to the stream.
@param encoder is the stream encoder
@param type is the Enum data-type
@param size if non-zero, is the size of the data-type in context
@throws IOException for errors in the underlying stream
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java