private int initFromDittedStringData(String text) throws IllegalArgumentException {
		int markOffset = -1;
		int mode = -1; // -1: looking for start, -2: skip to EOL, 0: hex mode, 1: binary mode
		ArrayList<Byte> ditarray = new ArrayList<Byte>();
		ArrayList<Byte> bitarray = new ArrayList<Byte>();
		int i = 0;
		while (i < text.length()) {
			char c1, c2;
			c1 = text.charAt(i);
			if (mode == -2 && c1 != '\n') {
				i += 1;
				continue;
			}
			if (Character.isWhitespace(c1)) {
				mode = -1;
				i += 1;
				continue;
			}
			if (c1 == '#') { // start comment - skip remainder of line 
				mode = -2;
				i += 1;
				continue;
			}
			if (mode == -1) {
				if (c1 == '0') {
					c2 = text.charAt(i + 1);
					if (c2 == 'x') {
						mode = 0;			// Normal hexdecimal mode
						i += 2;
						continue;
					}
				}
				else if (c1 == '*') {
					markOffset = ditarray.size();		// Set mark at current number of bytes specified
					i += 1;
					continue;
				}
				else if ((c1 == '0') || (c1 == '1') || (c1 == '.')) {
					mode = 1;
				}
				else {
					throw new IllegalArgumentException("Bad ditted bit sequence");
				}
			}
			if (mode == 0) {
				c2 = text.charAt(i + 1);
				i += 2;
				int val = 0;
				int mask = 0xff;
				if (c1 == '.') {
					mask ^= 0xf0;
				}
				else {
					val = Character.getNumericValue(c1) << 4;
				}
				if (c2 == '.') {
					mask ^= 0xf;
				}
				else {
					val |= Character.getNumericValue(c2);
				}

				bitarray.add(Byte.valueOf((byte) val));
				ditarray.add(Byte.valueOf((byte) mask));
			}
			else {
				int val = 0;
				int mask = 0;
				for (int j = 0; j < 8; ++j) {
					c1 = text.charAt(i + j);
					if (c1 == '0') {
						val <<= 1;
						mask <<= 1;
						mask |= 1;
					}
					else if (c1 == '.') {
						val <<= 1;
						mask <<= 1;
					}
					else {
						val <<= 1;
						val |= 1;
						mask <<= 1;
						mask |= 1;
					}
				}
				i += 8;
				bitarray.add(Byte.valueOf((byte) val));
				ditarray.add(Byte.valueOf((byte) mask));
			}
		}
		bits = new byte[bitarray.size()];
		dits = new byte[ditarray.size()];
		for (int k = 0; k < bits.length; ++k) {
			bits[k] = bitarray.get(k).byteValue();
			dits[k] = ditarray.get(k).byteValue();
		}
		return markOffset;
	}
Initialize this sequence with a ditted sequence from a string in the form
   (e.g. - 011...1., 0x.F, 01110011 0xAB)
   
@param text ditted sequence

@return number of bytes in the ditted sequence

@throws IllegalArgumentException if string is malformed
Ghidra/Features/Base/src/main/java/ghidra/util/bytesearch/DittedBitSequence.java