Also, there is no void constructor for DataInputStream. i.e. you cannot say
Instead, you must give it an InputStream as a parameter. e.g.
where 'instr' is a previously opened InputStream.
Joined: Aug 27, 2005
Also, there are spelling mistakes all over the place. Such as:
which should be
which should be
Also, the input code should be surrounded by a try/catch block.
Also, DataInputStream.readLine() has been deprecated. This means that it's use is being discouraged and may be unsupported in future versions of the Java api.
See this note from the API documentation:
Deprecated. This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form: DataInputStream d = new DataInputStream(in); with: BufferedReader d = new BufferedReader(new InputStreamReader(in));
I tried to clean up the code as much as I could. There are still problems, which I will leave for you to sort out, but this is much healthier version of the code. (see below)
Welcome to the Ranch! It looks like some others have taken the time to figure out what problems you might mean. For future reference, you can help us help you more easily (and quickly) if you tell us what problems you have encountered. For example, if you are getting errors when you compile your code, you should post the error messages that you get. The more specific your questions and the more details you give us, the better we will be able to help answer the right question rather than guessing and getting off track on something you might already understand. For more suggestions on how to asks questions to get the answers you want and need, take a look at this page in our FAQ.