title: What is wrong with my serialization mechanism?
body: <p>This is the code which works fine on Mac OS (JDK 1.6):</p>
  
  <pre><code>String s1 = "test";
  ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes());
  String s2 = (String)(new ObjectInputStream(in).readObject());
  </code></pre>
  
  <p>On linux CentOS 5.4 Java says:</p>
  
  <pre><code>java.io.StreamCorruptedException: invalid stream header: 3F3F0005
  at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
  at java.io.ObjectInputStream.&lt;init&gt;(ObjectInputStream.java:280)
  at com.XXX.SerializableTest.testWorks(SerializableTest.java:26)
  [...]
  </code></pre>
  
  <p>What is it about?</p>