@Override public String readLine() throws IOException {
  StringBuilder result=new StringBuilder();
  for (; ; ) {
    int intRead=read();
    if (intRead == -1) {
      return result.length() == 0 ? null : result.toString();
    }
    char c=(char)intRead;
    if (c == '\n' || c == '\r')     break;
    result.append(c);
  }
  return result.toString();
}

@ Override public String readLine ( ) throws IOException { StringBuilder result = new StringBuilder ( ) ; for ( ; ; ) { int intRead = read ( ) ; if ( intRead == - 1 ) { return result . length ( ) == 0 ? null : result . toString ( ) ; } char c = ( char ) intRead ; if ( c == '\n' || c == '\r' ) break ; result . append ( c ) ; } return result . toString ( ) ; }
reads a line of text . a line is considered to be terminated by any one of a line feed ( ' \ n ' ) , a carriage return ( ' \ r ' ) , or a carriage return followed immediately by a linefeed .
