I have a Java server and an Android Client.
The server sends the dimension of a file to the client.
The client receives the object in.readObject().
I need to cast the object returned by in.readObject() to int.
If I do
int filesize = (Integer) in.readObject()
there are no problems at compile time but Android client execution stops without error or warnings. If I try logging the object received it displays the file dimension sent correctly.
You will get object as response from stream. First you need to cast to object then type you want to.