I am trying to serialize a object to a String of bytes, and then back again. I want to show the bytes in a web app, the user can copy the data from the web site and paste it into a another web site to deserialize the object again. BUT...

This works.. but if i use the out commented line instead of the line above I get..
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
at Test.main(Test.java:32)
Edited by: Kristian Lind on Oct 4, 2012 11:41 AM