title: java - invoking standard deserialization inside custom deserialization
body: <p>I have a simple data structure which is serialized and deserialized.
  Upon deserialization, I wish that the data structure itself makes a subsequent processing step. In our case, it should simply call String.intern() on all the strings it contains.</p>
  
  <hr>
  
  <p>Preemptive answers to unrelated questions:</p>
  
  <p>Why don't you simply do this after normally deserializing the object?</p>
  
  <ol>
  <li>This object is serialized/deserialized in a lot of places</li>
  <li>This data structure is part of bigger objects which are serialized/deserialized, so you would have to browse any encapsulating object after deserialization as well</li>
  <li>Other developpers using the framework might not be aware or forget this step, and would result in a huge bug magnet</li>
  <li>It would be ugly</li>
  </ol>
  
  <p>Why do you use String.intern() in the first place?</p>
  
  <p>For performance reasons. We do massive text processing and computation requiring this.</p>
  
  <hr>
  
  <p>In other words, in:</p>
  
  <pre><code>public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException;
  </code></pre>
  
  <p>Is there a way to invoke the default/standard deserialization inside? (So that we can just add our little step afterwards)</p>
  
  <p>Thanks!</p>
  
  <p>Arnaud</p>