fixed the issue. Will look into that further The value 20646520 is in ASCII @A. ObjectInput/OutputStreams use a "magic" value at the beginning of the stream, to indicate it complies to the special serialization of the objects. (I think this was 0xCAFEBABE, but I'm not sure)
Java invalid stream header: 7371007E
By : Neha Deshmukh
Date : March 29 2020, 07:55 AM
I hope this helps . You've likely got your streams in a twist. When you construct an ObjectInputStream, the constructor reads the first two bytes from the stream expecting them to be the "magic values" that should be present in an object stream. If they're not there, it throws the StreamCorruptedException (this is all in the ObjectInputStream source code).
seems to work fine ObjectInputStream expects a header in the stream that is written by ObjectOutputStream. So If you use one, you need to use both. As your sample doesn't really need ObjectOutputStream, you may just want to not use ObjectInputStream.