EOFException in ReadUTF. Please help!!
Hi, I磎 reading a string sent by a servlet to a middlet, using ReadUTF. In a fist moment it worked, by now it throws a java.io.EOFException, I don磘 know why, I think I磛e modified anything.
The midlet receive string code is:
httpConn = (HttpConnection)Connector.open(url);
inStr = httpConn.openInputStream();
DataInputStream dinStr=new DataInputStream(inStr);
DataReceived=dinStr.readUTF(dinStr);
inStr.close();
httpConn.close();
The servlet sends a string using writeUTF:
ServletOutputStream out = response.getOutputStream();
DataOutputStream dout =new DataOutputStream(out);
dout.writeUTF(datatosend);
dout.flush();
dout.close();
Where could be the problem? ReadUTF throws a EOFException when the end of file is reaches? Then why DataReceived doesn磘 contain anything?
I also check if the response code of the servlet is HTTP_OK, that磗 the case.
Sholud I work with the content length or it磗 no necessary to work with readUTF and Strings?
Thanks in advance.

