@Override
	protected DataTypeComponent[] getAllComponents(MemBuffer buf) {
		Memory memory = buf.getMemory();
		Address start = buf.getAddress();

		// Find count
		int n = (int) getCount(memory, start.add(counterOffset));

		DataTypeComponent[] comps = new DataTypeComponent[n + 1];
		DataTypeInstance dti = DataTypeInstance.getDataTypeInstance(header, buf, false);

		if (dti == null) {
			Msg.error(this, "ERROR: problem with data at " + buf.getAddress());
			return null;
		}
		int countSize = dti.getLength();
		comps[0] =
			new ReadOnlyDataTypeComponent(dti.getDataType(), this, countSize, 0, 0,
				header.getName() + "_" + buf.getAddress(), "");
		int offset = countSize;
		MemoryBufferImpl newBuf = new MemoryBufferImpl(memory, buf.getAddress());
		try {
			newBuf.advance(countSize);
			for (int i = 1; i <= n; i++) {
				dti = DataTypeInstance.getDataTypeInstance(baseStruct, buf, false);
				if (dti == null) {
					Msg.error(this, "ERROR: problem with data at " + buf.getAddress());
					return null;
				}
				int len = dti.getLength();
				comps[i] = new ReadOnlyDataTypeComponent(dti.getDataType(), this, len, i, offset,
					baseStruct.getName() + "_" + newBuf.getAddress(), "");
				offset += len;
				newBuf.advance(len);
			}
		}
		catch (AddressOverflowException e) {
			Msg.error(this, "ERROR: problem with data at " + buf.getAddress());
			return null;
		}
		return comps;
	}
Constructor for this dynamic data type builder.

@param name name of this dynamic data type
@param description description of the data type
@param header header data type that will contain the number of following elements
@param baseStruct base data type for each of the following elements
@param counterOffset offset of the number of following elements from the start of the header
@param counterSize size of the count in bytes
@param mask mask to apply to the count value to get the actual number of following elements.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/CountedDynamicDataType.java