public String readLine() throws IOException {
  StringBuilder buf=new StringBuilder();
  byte b=(byte)read();
  while (b != '\n') {
    buf.append((char)b);
    b=(byte)in.read();
    if (getPosition() >= length())     break;
  }
  return buf.toString();
}

public String readLine ( ) throws IOException { StringBuilder buf = new StringBuilder ( ) ; byte b = ( byte ) read ( ) ; while ( b != '\n' ) { buf . append ( ( char ) b ) ; b = ( byte ) in . read ( ) ; if ( getPosition ( ) >= length ( ) ) break ; } return buf . toString ( ) ; }
read bytes until next end of line
