@Override
	public void writeSpace(AttributeId attribId, AddressSpace spc) throws IOException {
		writeHeader(ATTRIBUTE, attribId.id());
		switch (spc.getType()) {
			case AddressSpace.TYPE_CONSTANT:
			case AddressSpace.TYPE_RAM:
			case AddressSpace.TYPE_REGISTER:
			case AddressSpace.TYPE_UNIQUE:
			case AddressSpace.TYPE_OTHER:
				writeInteger((TYPECODE_ADDRESSSPACE << TYPECODE_SHIFT), spc.getUnique());
				break;
			case AddressSpace.TYPE_VARIABLE:
				outStream.write((TYPECODE_SPECIALSPACE << TYPECODE_SHIFT) | SPECIALSPACE_JOIN);
				break;
			case AddressSpace.TYPE_STACK:
				outStream.write((TYPECODE_SPECIALSPACE << TYPECODE_SHIFT) | SPECIALSPACE_STACK);
				break;
			default:
				throw new IOException("Cannot marshal address space: " + spc.getName());
		}
	}
A byte-based encoder designed to marshal to the decompiler efficiently
See {@code PackedDecode} for details of the encoding format
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PackedEncode.java