简体   繁体   中英

java.io.StreamCorrupted Exception` in android Client

I am making a connection from Android client to Servlet using url connection. I am sending a string to server on button click.Server is receiving string and able to print it. When the Servlet sends response as a string, The Android Client Client is showing the following Exceoption
java.io.StreamCorrupted Exception
What can be the reason for such an exception?

This exception will be thrown if the expected input stream is not proper .

For example:

If the expected input stream on the client side is ObjectInputStream and the server is not writing using ObjectOutputStream .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM