@Nullable private IgniteBiTuple<State,Delimiter> findFirstDelimiter(IgfsInputStream stream,long startPos) throws IOException {
  State state;
  Delimiter delim;
  long curPos=Math.max(0,startPos - maxDelimLen);
  while (true) {
    stream.seek(curPos);
    state=new State();
    delim=nextDelimiter(stream,state);
    if (curPos == 0 || delim == null || delim.start - curPos > maxDelimLen - 1)     break;
 else     curPos=Math.max(0,curPos - maxDelimLen);
  }
  return F.t(state,delim);
}

@ Nullable private IgniteBiTuple < State , Delimiter > findFirstDelimiter ( IgfsInputStream stream , long startPos ) throws IOException { State state ; Delimiter delim ; long curPos = Math . max ( 0 , startPos - maxDelimLen ) ; while ( true ) { stream . seek ( curPos ) ; state = new State ( ) ; delim = nextDelimiter ( stream , state ) ; if ( curPos == 0 || delim == null || delim . start - curPos > maxDelimLen - 1 ) break ; else curPos = Math . max ( 0 , curPos - maxDelimLen ) ; } return F . t ( state , delim ) ; }
find first delimiter . in order to achieve this we have to rewind the stream until we find the delimiter which stands at least [ maxdelimlen ] from the start search position or until we faced stream start . otherwise we cannot be sure that delimiter position is determined correctly .
