will be helpful for those in need I'm trying to develop a Java client-server application, where multiple clients can connect to the server. I start a separate thread for each incoming client, pass the client socket to the thread, and then open a pair of streams to maintain communication. And I got this java.io.StreamCorruptedException - invalid code type AC. , You need to fix this bit first:
ConnectThread ct = new ConnectThread(clientSocket);
With these it helps I would say you're writing to or reading from the streams simultaneously in two or more threads. That's the only explanation for 'stream active', and it may well explain the other problem too. NB You don't need that business of creating the streams in different orders. Always create the ObjectOutputStream first. You should create those streams in the run() method of your Runnable, not where you're doing it: it involves blocking I/O which should only be done in that thread.
it should still fix some issue Since XML is a string and decompression almost certainly expects binary data as the input, then the value of the StreamData attribute must be an ASCII/string encoded representation of binary data. This could be using a simple bin-2-hex notation but from the example provided in the question, it looks more likely to be base64 or similar. Whoever is providing the XML should be able to confirm the encoding for you.