code: private void initOffsets() {
      if (offsets == null) {
        int count;
        int index;
        // count names
        count = 0;
        index = 0;
        while (index < path.length) {
          byte c = path[index++];
          if (c != '/') {
            count++;
            while (index < path.length && path[index] != '/')
              index++;
          }
        }
        // populate offsets
        int[] result = new int[count];
        count = 0;
        index = 0;
        while (index < path.length) {
          byte c = path[index];
          if (c == '/') {
            index++;
          } else {
            result[count++] = index++;
            while (index < path.length && path[index] != '/')
              index++;
          }
        }
        synchronized (this) {
          if (offsets == null)
            offsets = result;
        }
      }
    }
docs: create offset list if not already created