@Override
	public final int getLength(MemBuffer buf, int maxLength) {
		DataTypeComponent[] comps = getComps(buf);
		if ((comps == null) || (comps.length < 1)) {
			return -1;
		}
		DataTypeComponent last = comps[comps.length - 1];
		int lastComponentLength = last.getLength();
		return last.getOffset() + lastComponentLength;
		// NOTE: any trailing alignment padding must be represented with
		// undefined components to achieve the correct length.  It may be 
		// best to do this for all padding within the component structure.
	}
Get all dynamic components associated with the specified MemBuffer
@param buf memory buffer positioned at start of data type instance
@return all components or null if memory data is not valid for this
data type.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DynamicDataType.java