code: protected I fixIndex(I idx) {
      //return idx;
      if (idx.size() < 2) {
        return idx;
      }
      NavigableMap<Integer, E> map = idx.getMapByNum();
      Iterator<? extends Map.Entry<Integer, E>> it = map.entrySet().iterator();
  
      // we have at least 2 elements in the iterator
      Map.Entry<Integer, E> curr = it.next();
      while (it.hasNext()) {
        Map.Entry<Integer, E> next = it.next();
        OffsetLength currOfflen = curr.getValue().getOffsetLength();
        OffsetLength nextOfflen = next.getValue().getOffsetLength();
        curr.getValue().setOffsetLength(
            new OffsetLength(currOfflen.offset, (int) (nextOfflen.offset - currOfflen.offset)));
        curr = next;
      }
      return idx;
    }
docs: The index as it is built by index builder contains offsets of "scan" tags, and their lengths.
  This leaves a gap between spectra (there might be spaces, newlines and tabs), so if you read a
  file like that with MzML parser, it will do lot's of small reads, because it will have to skip
  those gaps. It's faster to read the file including those gaps, so we'll be fixing the
  initially-built "proper" index, to one, that has lengths of spectra spanning from the beginning
  of one spectrum tag, to the beginning of the next one.