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();
}

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 ( ) ; }
reads a string until the specified delimiter or eof is encountered
