private void mapTranslations()

in library/src/main/java/com/whatsapp/stringpacks/MMappedStringPack.java [112:139]


  private void mapTranslations(@IntRange(from = 0) int startOfLocaleData, int headerStart) {
    int caret = startOfLocaleData + headerStart;
    final int numStrings = read16BitsFrom(caret);
    caret += 2; // Increment by 2 Bytes which is the number of strings read above
    final int numPlurals = read16BitsFrom(caret);
    caret += 2; // Increment by 2 Bytes which is number of plurals read above

    for (int i = 0; i < numStrings; i++) {
      final int id = read16BitsFrom(caret);
      caret += 2; // Increment by 2 Bytes which is the id of the string read above
      stringSparseArray.append(id, caret);
      caret += 6; // Increment by 6 Bytes which is string starting location (4) + string length (2)
      // to be read later when string is fetched
    }

    for (int i = 0; i < numPlurals; i++) {
      final int id = read16BitsFrom(caret);
      caret += 2; // Increment by 2 Bytes which is the id of the plural read above
      pluralSparseArray.append(id, caret);
      final int quantityCount = mappedByteBuffer.get(caret);
      caret++; // Increment by a single byte which are for quantity count read above
      for (int j = 0; j < quantityCount; j++) {
        caret += 7; // Increment by 7 Bytes which is the
        // quantity id (1) + string starting location (4) + string length (2) to be
        // read later when plural is fetched
      }
    }
  }