public static Join decodePieces(Decoder decoder) throws DecoderException {
		ArrayList<Varnode> list = new ArrayList<>();
		int sizeAccum = 0;
		int logicalSize = 0;
		for (;;) {
			int attribId = decoder.getNextAttributeId();
			if (attribId == 0) {
				break;
			}
			else if (attribId == ATTRIB_LOGICALSIZE.id()) {
				logicalSize = (int) decoder.readUnsignedInteger();
			}
			else if (attribId == ATTRIB_UNKNOWN.id()) {
				attribId = decoder.getIndexedAttributeId(ATTRIB_PIECE);
			}

			if (attribId >= ATTRIB_PIECE.id()) {
				int index = attribId - ATTRIB_PIECE.id();
				if (index > AddressXML.MAX_PIECES) {
					continue;
				}
				if (index != list.size()) {
					throw new DecoderException("\"piece\" attributes must be in order");
				}
				Varnode vn = decodePiece(decoder.readString(), decoder.getAddressFactory());
				list.add(vn);
				sizeAccum += vn.getSize();
			}
		}
		Join join = new Join();
		join.pieces = new Varnode[list.size()];
		join.logicalSize = (logicalSize != 0) ? logicalSize : sizeAccum;
		list.toArray(join.pieces);
		return join;
	}
Decode a sequence of Varnodes from "piece" attributes for the current open element.
The Varnodes are normally associated with an Address in the "join" space. In this virtual
space, a contiguous sequence of bytes, at a specific Address, represent a logical value
that may physically be split across multiple registers or other storage locations.
@param decoder is the stream decoder
@return an array of decoded Varnodes and the logical size
@throws DecoderException for any errors in the encoding
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/Varnode.java