private void refill(){
  if (bufferLen > 64) {
    int last=bufferLen - 1;
    buffer[0]=buffer[last];
    startOffset[0]=startOffset[last];
    endOffset[0]=endOffset[last];
    bufferLen=1;
    index-=last;
  }
  char termBuffer[]=termAtt.buffer();
  int len=termAtt.length();
  int start=offsetAtt.startOffset();
  int end=offsetAtt.endOffset();
  int newSize=bufferLen + len;
  buffer=ArrayUtil.grow(buffer,newSize);
  startOffset=ArrayUtil.grow(startOffset,newSize);
  endOffset=ArrayUtil.grow(endOffset,newSize);
  lastEndOffset=end;
  if (end - start != len) {
    for (int i=0, cp=0; i < len; i+=Character.charCount(cp)) {
      cp=buffer[bufferLen]=Character.codePointAt(termBuffer,i,len);
      startOffset[bufferLen]=start;
      endOffset[bufferLen]=end;
      bufferLen++;
    }
  }
 else {
    for (int i=0, cp=0, cpLen=0; i < len; i+=cpLen) {
      cp=buffer[bufferLen]=Character.codePointAt(termBuffer,i,len);
      cpLen=Character.charCount(cp);
      startOffset[bufferLen]=start;
      start=endOffset[bufferLen]=start + cpLen;
      bufferLen++;
    }
  }
}

private void refill ( ) { if ( bufferLen > 64 ) { int last = bufferLen - 1 ; buffer [ 0 ] = buffer [ last ] ; startOffset [ 0 ] = startOffset [ last ] ; endOffset [ 0 ] = endOffset [ last ] ; bufferLen = 1 ; index -= last ; } char termBuffer [ ] = termAtt . buffer ( ) ; int len = termAtt . length ( ) ; int start = offsetAtt . startOffset ( ) ; int end = offsetAtt . endOffset ( ) ; int newSize = bufferLen + len ; buffer = ArrayUtil . grow ( buffer , newSize ) ; startOffset = ArrayUtil . grow ( startOffset , newSize ) ; endOffset = ArrayUtil . grow ( endOffset , newSize ) ; lastEndOffset = end ; if ( end - start != len ) { for ( int i = 0 , cp = 0 ; i < len ; i += Character . charCount ( cp ) ) { cp = buffer [ bufferLen ] = Character . codePointAt ( termBuffer , i , len ) ; startOffset [ bufferLen ] = start ; endOffset [ bufferLen ] = end ; bufferLen ++ ; } } else { for ( int i = 0 , cp = 0 , cpLen = 0 ; i < len ; i += cpLen ) { cp = buffer [ bufferLen ] = Character . codePointAt ( termBuffer , i , len ) ; cpLen = Character . charCount ( cp ) ; startOffset [ bufferLen ] = start ; start = endOffset [ bufferLen ] = start + cpLen ; bufferLen ++ ; } } }
refills buffers with new data from the current token .
