DataInputStream uses Unicode to represent the data. Check the
documentation. I am not sure if attachments are allowed on this list,
but I try to attach the file you need. Otherwise you can generate the
file using the following program derived from yours ;)
Regarding the EOF you could use EOFException, but I am sure there are
more elegant ways.
If you want to read data files which have the format you mentioned in
your email I suggest to use BufferedReader + StringTokenizer.