private String readLine(){
  StringBuffer sb=new StringBuffer();
  while (buf.remaining() > 0) {
    char c=(char)buf.get();
    if (c == '\r') {
      if (buf.remaining() > 0) {
        char n=(char)buf.get(buf.position());
        if (n == '\n') {
          buf.get();
        }
      }
      break;
    }
 else     if (c == '\n') {
      break;
    }
    sb.append(c);
  }
  return sb.toString();
}

private String readLine ( ) { StringBuffer sb = new StringBuffer ( ) ; while ( buf . remaining ( ) > 0 ) { char c = ( char ) buf . get ( ) ; if ( c == '\r' ) { if ( buf . remaining ( ) > 0 ) { char n = ( char ) buf . get ( buf . position ( ) ) ; if ( n == '\n' ) { buf . get ( ) ; } } break ; } else if ( c == '\n' ) { break ; } sb . append ( c ) ; } return sb . toString ( ) ; }
read a line of text . this follows the semantics of readline ( ) in datainput - - it reads character by character until a ' \ n ' is encountered . if a ' \ r ' is encountered , it is discarded .
