code: public void putIndex(IndexRecord rec, int partition) {
      final int pos = partition * MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH / 8;
      entries.put(pos, rec.startOffset);
      entries.put(pos + 1, rec.rawLength);
      entries.put(pos + 2, rec.partLength);
    }
docs: Set spill offsets for given partition.