private byte[] getStructureComponentAlignmentBytes(Data data) {

		Data parent = data.getParent();
		if (parent == null) {
			return null;
		}
		DataType baseDataType = parent.getBaseDataType();
		if (!(baseDataType instanceof Structure)) {
			return null; // e.g., union
		}
		Structure struct = (Structure) baseDataType;
		if (!struct.isPackingEnabled()) {
			return null;
		}

		int alignSize = 0;
		int ordinal = data.getComponentIndex();
		if (ordinal == (struct.getNumComponents() - 1)) {
			alignSize = (int) (parent.getMaxAddress().subtract(data.getMaxAddress()));
		}
		else {
			Data nextComponent = parent.getComponent(ordinal + 1);
			if (nextComponent == null) {
				return null; // this should never happen
			}
			alignSize = (int) (nextComponent.getMinAddress().subtract(data.getMaxAddress())) - 1;
		}
		if (alignSize <= 0) {
			return null;
		}

		int alignmentOffset = data.getParentOffset() + data.getLength();
		byte[] bytes = new byte[alignSize];
		parent.getBytes(bytes, alignmentOffset);
		return bytes;
	}
Constructor
@param model the model that the field belongs to.
@param hlProvider the HightLightStringProvider.
@param displayOptions the Options for display properties.
@param fieldOptions the Options for field specific properties.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/BytesFieldFactory.java