title: How can I debug / view ObjectInputStream data?
body: <p>I have a javaagent attached to a remote process using agentmain which sends serialized java objects via socket to a client application. </p>
  
  <p>There appears to be a bug in the formatting of the stream which I am not sure if it is an error in my writeExternal implementation or if it is something to do with the java versions. I am experimenting with different combinations of java 1.6 32 / 64 bits. </p>
  
  <p>Basically the object stream is throwing a class not found exception, but the package name printed is something like org.mycode.b.e.b., the b.e.b part is nothing to do with any packages I own and I have searched all over and there is nothing in my code or libraries with that string... b.e.b. </p>
  
  <p>So I am suspicious it is an encoding issue caused by either a encoding format discrepancy or a 32/64 bit word length issue, but I am not that experienced in these areas.</p>
  
  <p>I am quite used to opening up the debugger to track down code issues, but less experienced diagnosing problems of this nature, with serialization and byte formats so I am asking to see what are the recommended approaches to debugging?</p>
  
  <p>I have control/compilation/source of the client which uses code like:</p>
  
  <pre><code>objectInput = new ObjectInput(inputStream);
  Object object = objectInput.readObject(); 
  </code></pre>
  
  <p>which currently throws class not found for the org.mycode.b.e.b.</p>
  
  <p>I was thinking about re-writing it to store the serialized stream to a file and taking a look ( not sure what format the file will actually be in in regard to reading it), is that the right angle?</p>