Skip to content Skip to sidebar Skip to footer

Android: Objectinputsteam.readfully() Gets Stuck

Situation : I send a boolean variable via ObjectOutputStream from a client to a server. Thereafter, I immediately send a string data via writeChars() function. The server receives

Solution 1:

If this is a String and you are using ObjectOutputStream you should just call writeUTF() to write it and readUTF() to read it. This method actually first writes the number of bytes to the stream and then the bytes. On the receiving end, it reads the number of bytes and then knows how many bytes to expect.


Post a Comment for "Android: Objectinputsteam.readfully() Gets Stuck"