private void pushTerm(BytesRef text) throws IOException {
  int limit=Math.min(lastTerm.length(),text.length);
  int pos=0;
  while (pos < limit && lastTerm.byteAt(pos) == text.bytes[text.offset + pos]) {
    pos++;
  }
  for (int i=lastTerm.length() - 1; i >= pos; i--) {
    int prefixTopSize=pending.size() - prefixStarts[i];
    if (prefixTopSize >= minItemsInBlock) {
      writeBlocks(i + 1,prefixTopSize);
      prefixStarts[i]-=prefixTopSize - 1;
    }
  }
  if (prefixStarts.length < text.length) {
    prefixStarts=ArrayUtil.grow(prefixStarts,text.length);
  }
  for (int i=pos; i < text.length; i++) {
    prefixStarts[i]=pending.size();
  }
  lastTerm.copyBytes(text);
}

private void pushTerm ( BytesRef text ) throws IOException { int limit = Math . min ( lastTerm . length ( ) , text . length ) ; int pos = 0 ; while ( pos < limit && lastTerm . byteAt ( pos ) == text . bytes [ text . offset + pos ] ) { pos ++ ; } for ( int i = lastTerm . length ( ) - 1 ; i >= pos ; i -- ) { int prefixTopSize = pending . size ( ) - prefixStarts [ i ] ; if ( prefixTopSize >= minItemsInBlock ) { writeBlocks ( i + 1 , prefixTopSize ) ; prefixStarts [ i ] -= prefixTopSize - 1 ; } } if ( prefixStarts . length < text . length ) { prefixStarts = ArrayUtil . grow ( prefixStarts , text . length ) ; } for ( int i = pos ; i < text . length ; i ++ ) { prefixStarts [ i ] = pending . size ( ) ; } lastTerm . copyBytes ( text ) ; }
pushes the new term to the top of the stack , and writes new blocks .
