int termCount = occurences.getTermCount();
        public void flush() {            //return early            if (this.doc == null)                return;                        final int wordsCount = words[0].size() + words[1].size();            if (wordsCount == 0)                return;            final ProgressIndicator progress = new ProgressIndicator(wordsCount, 100);            final short collectionId = this.doc.getCollection().getId();            int count = 0;            for (byte currentSection = 0; currentSection <= ATTRIBUTE_SECTION; currentSection++) {                for (Iterator i = words[currentSection].entrySet().iterator(); i.hasNext(); count++) {                    Map.Entry entry = (Map.Entry) i.next();                    String token = (String) entry.getKey();                    OccurrenceList occurences = (OccurrenceList) entry.getValue();                    int termCount = occurences.getTermCount();                    //Don't forget this one                    occurences.sort();                                        os.clear();                    os.writeInt(this.doc.getDocId());                    switch (currentSection) {                        case TEXT_SECTION :                            os.writeByte(TEXT_SECTION);                            break;                        case ATTRIBUTE_SECTION :                            os.writeByte(ATTRIBUTE_SECTION);                            break;                        default :                            throw new IllegalArgumentException("Invalid section type in '" + dbTokens.getFile().getName() +                             "' (inverted index)");                    }                                        os.writeInt(termCount);                    //TOUNDERSTAND -pb                                 int lenOffset = os.position();                    os.writeFixedInt(0);                    long previousGID = 0;                    for (int j = 0; j < occurences.getSize(); ) {                        long delta = occurences.nodes[j] - previousGID;                        os.writeLong(delta);                                                                int freq = occurences.getOccurrences(j);                        os.writeInt(freq);                        for (int k = 0; k < freq; k++) {                            os.writeInt(occurences.offsets[j + k]);                        }                          previousGID = occurences.nodes[j];                                j += freq;                                            }                    os.writeFixedInt(lenOffset, os.position() - lenOffset - 4);                                        flushWord(collectionId, token, os.data());                    progress.setValue(count);                    if (progress.changed()) {                        setChanged();                        notifyObservers(progress);                    }                }                //TOUNDERSTAND : is this a flush ?                 //If so, the ProgressIndicator should be reinitialized -pb                if (wordsCount > 100) {                    progress.finish();                    setChanged();                    notifyObservers(progress);                }                words[currentSection].clear();            }        }