public void encode(Encoder encoder, long ref, PcodeDataTypeManager dtmanage)
				throws IOException {
			encoder.openElement(ELEM_CPOOLREC);
			encoder.writeUnsignedInteger(ATTRIB_REF, ref);
			if (tag == STRING_LITERAL) {
				encoder.writeString(ATTRIB_TAG, "string");
			}
			else if (tag == CLASS_REFERENCE) {
				encoder.writeString(ATTRIB_TAG, "classref");
			}
			else if (tag == POINTER_METHOD) {
				encoder.writeString(ATTRIB_TAG, "method");
			}
			else if (tag == POINTER_FIELD) {
				encoder.writeString(ATTRIB_TAG, "field");
			}
			else if (tag == ARRAY_LENGTH) {
				encoder.writeString(ATTRIB_TAG, "arraylength");
			}
			else if (tag == INSTANCE_OF) {
				encoder.writeString(ATTRIB_TAG, "instanceof");
			}
			else if (tag == CHECK_CAST) {
				encoder.writeString(ATTRIB_TAG, "checkcast");
			}
			else {
				encoder.writeString(ATTRIB_TAG, "primitive");
			}
			if (isConstructor) {
				encoder.writeBool(ATTRIB_CONSTRUCTOR, true);
			}
			if (tag == PRIMITIVE) {
				encoder.openElement(ELEM_VALUE);
				encoder.writeUnsignedInteger(ATTRIB_CONTENT, value);
				encoder.closeElement(ELEM_VALUE);
			}
			if (byteData != null) {
				encoder.openElement(ELEM_DATA);
				encoder.writeSignedInteger(ATTRIB_LENGTH, byteData.length);
				StringBuilder buf = new StringBuilder();
				int wrap = 0;
				for (byte val : byteData) {
					int hival = (val >> 4) & 0xf;
					char hi = (char) ((hival > 9) ? hival - 10 + 'a' : hival + '0');
					int loval = val & 0xf;
					char lo = (char) ((loval > 9) ? loval - 10 + 'a' : loval + '0');
					buf.append(hi).append(lo).append(' ');
					wrap += 1;
					if (wrap > 15) {
						buf.append('\n');
						wrap = 0;
					}
				}
				encoder.writeString(ATTRIB_CONTENT, buf.toString());
				encoder.closeElement(ELEM_DATA);
			}
			else {
				encoder.openElement(ELEM_TOKEN);
				encoder.writeString(ATTRIB_CONTENT, token);
				encoder.closeElement(ELEM_TOKEN);
			}
			dtmanage.encodeTypeRef(encoder, type, type.getLength());
			encoder.closeElement(ELEM_CPOOLREC);
		}
Class for manipulating "deferred" constant systems like the java virtual machine constant pool
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ConstantPool.java