private int parseEndOfLine(String headerPart,int end){
  int index=end;
  for (; ; ) {
    int offset=headerPart.indexOf('\r',index);
    if (offset == -1 || offset + 1 >= headerPart.length()) {
      throw new IllegalStateException("Expected headers to be terminated by an empty line.");
    }
    if (headerPart.charAt(offset + 1) == '\n') {
      return offset;
    }
    index=offset + 1;
  }
}

private int parseEndOfLine ( String headerPart , int end ) { int index = end ; for ( ; ; ) { int offset = headerPart . indexOf ( '\r' , index ) ; if ( offset == - 1 || offset + 1 >= headerPart . length ( ) ) { throw new IllegalStateException ( "Expected headers to be terminated by an empty line." ) ; } if ( headerPart . charAt ( offset + 1 ) == '\n' ) { return offset ; } index = offset + 1 ; } }
skips bytes until the end of the current line .
