@Override
	public boolean patchIntegerAttribute(int pos, AttributeId attribId, long val) {
		int typeByte;
		int length;

		pos = skipOpen(pos);
		if (pos < 0) {
			return false;
		}
		for (;;) {
			int header1 = editStream.getByte(pos);	// Attribute header
			if ((header1 & HEADER_MASK) != ATTRIBUTE) {
				return false;
			}
			pos += 1;
			int curid = header1 & ELEMENTID_MASK;
			if ((header1 & HEADEREXTEND_MASK) != 0) {
				curid <<= RAWDATA_BITSPERBYTE;
				curid |= editStream.getByte(pos) & RAWDATA_MASK;
				pos += 1;				// Extra byte for extended id
			}
			typeByte = editStream.getByte(pos) & 0xff;	// Type (and length) byte
			pos += 1;
			int attribType = typeByte >> TYPECODE_SHIFT;
			if (attribType == TYPECODE_BOOLEAN || attribType == TYPECODE_SPECIALSPACE) {
				continue;								// has no additional data
			}
			length = typeByte & LENGTHCODE_MASK;	// Length of data in bytes
			if (attribType == TYPECODE_STRING) {			// For a string
				length = (int) readInteger(pos, length);	// Read length field to get final length of string
			}
			if (attribId.id() == curid) {
				break;
			}
			pos += length;			// Skip -length- data	
		}
		if (length != 10) {
			return false;
		}

		for (int sa = 9 * RAWDATA_BITSPERBYTE; sa >= 0; sa -= RAWDATA_BITSPERBYTE) {
			long piece = (val >>> sa) & RAWDATA_MASK;
			piece |= RAWDATA_MARKER;
			editStream.insertByte(pos, (int) piece);
			pos += 1;
		}
		return true;
	}
Read the integer at the given position.
@param pos is the given position
@param len is the length of the integer in 7-bit bytes
@return the integer
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PatchPackedEncode.java