public static void save(DataOrganization dataOrg, DBStringMapAdapter dataMap, String keyPrefix)
			throws IOException {

		for (String key : dataMap.keySet()) {
			if (key.startsWith(keyPrefix)) {
				dataMap.delete(key);
			}
		}

		if (dataOrg.isBigEndian()) { // default is little-endian
			dataMap.put(keyPrefix + BIG_ENDIAN_NAME, Boolean.TRUE.toString());
		}

		int absoluteMaxAlignment = dataOrg.getAbsoluteMaxAlignment();
		if (absoluteMaxAlignment != NO_MAXIMUM_ALIGNMENT) {
			dataMap.put(keyPrefix + ELEM_ABSOLUTE_MAX_ALIGNMENT.name(),
				Integer.toString(absoluteMaxAlignment));
		}

		int machineAlignment = dataOrg.getMachineAlignment();
		if (machineAlignment != DEFAULT_MACHINE_ALIGNMENT) {
			dataMap.put(keyPrefix + ELEM_MACHINE_ALIGNMENT.name(),
				Integer.toString(machineAlignment));
		}

		int defaultAlignment = dataOrg.getDefaultAlignment();
		if (defaultAlignment != DEFAULT_DEFAULT_ALIGNMENT) {
			dataMap.put(keyPrefix + ELEM_DEFAULT_ALIGNMENT.name(),
				Integer.toString(defaultAlignment));
		}

		int defaultPointerAlignment = dataOrg.getDefaultPointerAlignment();
		if (defaultPointerAlignment != DEFAULT_DEFAULT_POINTER_ALIGNMENT) {
			dataMap.put(keyPrefix + ELEM_DEFAULT_POINTER_ALIGNMENT.name(),
				Integer.toString(defaultPointerAlignment));
		}

		int pointerSize = dataOrg.getPointerSize();
		if (pointerSize != DEFAULT_POINTER_SIZE) {
			dataMap.put(keyPrefix + ELEM_POINTER_SIZE.name(), Integer.toString(pointerSize));
		}

		int pointerShift = dataOrg.getPointerShift();
		if (pointerShift != DEFAULT_POINTER_SHIFT) {
			dataMap.put(keyPrefix + ELEM_POINTER_SHIFT.name(), Integer.toString(pointerShift));
		}

		boolean isSignedChar = dataOrg.isSignedChar();
		if (!isSignedChar) {
			// NOTE: This differs from XML element name
			dataMap.put(keyPrefix + SIGNED_CHAR_TYPE_NAME, Boolean.toString(isSignedChar));
		}

		int charSize = dataOrg.getCharSize();
		if (charSize != DEFAULT_CHAR_SIZE) {
			dataMap.put(keyPrefix + ELEM_CHAR_SIZE.name(), Integer.toString(charSize));
		}

		int wideCharSize = dataOrg.getWideCharSize();
		if (wideCharSize != DEFAULT_WIDE_CHAR_SIZE) {
			dataMap.put(keyPrefix + ELEM_WCHAR_SIZE.name(), Integer.toString(wideCharSize));
		}

		int shortSize = dataOrg.getShortSize();
		if (shortSize != DEFAULT_SHORT_SIZE) {
			dataMap.put(keyPrefix + ELEM_SHORT_SIZE.name(), Integer.toString(shortSize));
		}

		int integerSize = dataOrg.getIntegerSize();
		if (integerSize != DEFAULT_INT_SIZE) {
			dataMap.put(keyPrefix + ELEM_INTEGER_SIZE.name(), Integer.toString(integerSize));
		}

		int longSize = dataOrg.getLongSize();
		if (longSize != DEFAULT_LONG_SIZE) {
			dataMap.put(keyPrefix + ELEM_LONG_SIZE.name(), Integer.toString(longSize));
		}

		int longLongSize = dataOrg.getLongLongSize();
		if (longLongSize != DEFAULT_LONG_LONG_SIZE) {
			dataMap.put(keyPrefix + ELEM_LONG_LONG_SIZE.name(), Integer.toString(longLongSize));
		}

		int floatSize = dataOrg.getFloatSize();
		if (floatSize != DEFAULT_FLOAT_SIZE) {
			dataMap.put(keyPrefix + ELEM_FLOAT_SIZE.name(), Integer.toString(floatSize));
		}

		int doubleSize = dataOrg.getDoubleSize();
		if (doubleSize != DEFAULT_DOUBLE_SIZE) {
			dataMap.put(keyPrefix + ELEM_DOUBLE_SIZE.name(), Integer.toString(doubleSize));
		}

		int longDoubleSize = dataOrg.getLongDoubleSize();
		if (longDoubleSize != DEFAULT_LONG_DOUBLE_SIZE) {
			dataMap.put(keyPrefix + ELEM_LONG_DOUBLE_SIZE.name(), Integer.toString(longDoubleSize));
		}

		for (int size : dataOrg.getSizes()) {
			String key = keyPrefix + ELEM_SIZE_ALIGNMENT_MAP.name() + "." + size;
			dataMap.put(key, Integer.toString(dataOrg.getSizeAlignment(size)));
		}

		BitFieldPackingImpl.save(dataOrg.getBitFieldPacking(), dataMap,
			keyPrefix + ELEM_BITFIELD_PACKING.name() + ".");
	}
Save the specified data organization to the specified DB data map.
All existing map entries starting with keyPrefix will be removed prior
to ading the new map entries.
@param dataOrg data organization
@param dataMap DB data map
@param keyPrefix key prefix for all map entries
@throws IOException if an IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataOrganizationImpl.java