+ /* add to top the size of the root item */
+ top += bundle->fRoot->fSize;
+ top += calcPadding(top);
+
+ /*
+ * formatVersion 1.1 (ICU 2.8):
+ * write int32_t indexes[] after root and before the strings
+ * to make it easier to parse resource bundles in icuswap or from Java etc.
+ */
+ uprv_memset(indexes, 0, sizeof(indexes));
+ indexes[URES_INDEX_LENGTH]= URES_INDEX_TOP;
+ indexes[URES_INDEX_STRINGS_TOP]= (int32_t)(usedOffset>>2);
+ indexes[URES_INDEX_RESOURCES_TOP]= (int32_t)(top>>2);
+ indexes[URES_INDEX_BUNDLE_TOP]= indexes[URES_INDEX_RESOURCES_TOP];
+ indexes[URES_INDEX_MAX_TABLE_LENGTH]= bundle->fMaxTableLength;
+
+ /*
+ * formatVersion 1.2 (ICU 3.6):
+ * write indexes[URES_INDEX_ATTRIBUTES] with URES_ATT_NO_FALLBACK set or not set
+ * the memset() above initialized all indexes[] to 0
+ */
+ if(bundle->noFallback) {
+ indexes[URES_INDEX_ATTRIBUTES]=URES_ATT_NO_FALLBACK;
+ }
+
+ /* write the indexes[] */
+ udata_writeBlock(mem, indexes, sizeof(indexes));
+
+ /* write the table key strings */
+ udata_writeBlock(mem, bundle->fKeys+URES_STRINGS_BOTTOM,
+ bundle->fKeyPoint-URES_STRINGS_BOTTOM);
+
+ /* write the padding bytes after the table key strings */