code: public static int chunkContainingPos(final long[] arr, final long pos) {
      final int nominalLength = arr.length - 1; /* remember, arr contains an "extra" position */
      assert nominalLength > 0;
      final long n = arr[nominalLength];
      assert 0 <= pos;
      assert pos < n;
      final int l = 0;
      final int r = nominalLength;
      // the following three asserts should probably be retained since they ensure
      // that the necessary invariants hold at the beginning of the search
      assert l < r;
      assert arr[l] <= pos;
      assert pos < arr[r];
      return searchForChunkContainingPos(arr, pos, l, r);
    }
docs: This is written in terms of a plain array to facilitate testing.
  @param arr the chunk containing the position
  @param pos the position
  @return the index of the chunk containing the position