docs: private static FileInputStream openFileRead(String dirName, String fullName, String firstPart, String secondPart) {
          try {
              return new FileInputStream(new File(dirName, fullName));
          } catch (FileNotFoundException ex1) {
              // If file name is too long hash it and try again.
              String message = ex1.getMessage();
              if (message != null && message.contains("File name too long")) {
                  if (secondPart != null) {
                      long hashedSecondPart = Hasher.hashString(secondPart);
                      fullName = firstPart + "." + Long.toString(hashedSecondPart);
                      // Note that we pass fullName as the second argument too.
                      return openFileRead(dirName, fullName, fullName, null);
                  } else if (firstPart != null) {
                      long hashedFirstPart = Hasher.hashString(firstPart);
                      fullName = Long.toString(hashedFirstPart);
                      return openFileRead(dirName, fullName, null, null);
                  } else {
                      // No hope.
                      Log.w("Could not open file for reading (name too long) " + fullName);
                  }
              }
              return null;
          }
      }