public static void setEndian(Data data, boolean bigEndian) throws Exception {
		for (int i = 0; i < data.getNumComponents(); i++) {
			Data component = data.getComponent(i);
			SettingsDefinition[] settings = component.getDataType().getSettingsDefinitions();
			for (int j = 0; j < settings.length; j++) {
				if (settings[j] instanceof EndianSettingsDefinition endianSetting) {
					endianSetting.setBigEndian(component, bigEndian);
				}
			}
			for (int j = 0; j < component.getNumComponents(); j++) {
				setEndian(component.getComponent(j), bigEndian);
			}
		}
	}
Recursively sets the given {@link Data} and its components to big/little endian

@param data The {@link Data}
@param bigEndian True to set to big endian; false to set to little endian
@throws Exception if there was a problem setting the endianness
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/StructConverter.java