question: public String readToDelimiter ( char delim ) throws FormatException { StringBuffer buildretval = new StringBuffer ( ) ; char tmp ; try { while ( ( tmp = readChar ( ) ) != delim ) buildretval . append ( tmp ) ; } catch ( EOFException e ) { } catch ( FormatException fe ) { if ( buildretval . length ( ) == 0 ) { throw fe ; } } return buildretval . toString ( ) ; }
target:  Reads a string until the specified delimiter or EOF is encountered