public static String readWord(DataInputStream dis) throws IOException {
  StringBuilder sb=new StringBuilder();
  char c;
  do {
    c=readChar(dis);
  }
 while (Character.isWhitespace(c));
  do {
    sb.append(c);
    c=readChar(dis);
  }
 while (!Character.isWhitespace(c));
  return sb.toString();
}

public static String readWord ( DataInputStream dis ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; char c ; do { c = readChar ( dis ) ; } while ( Character . isWhitespace ( c ) ) ; do { sb . append ( c ) ; c = readChar ( dis ) ; } while ( ! Character . isWhitespace ( c ) ) ; return sb . toString ( ) ; }
reads the next word ( text separated by whitespace ) from the given stream
