Deserialize at construction
<p>I have a class that implements <code>Serializable</code>. I have a method in it that serializes itself:</p>

<pre><code>...
fos = new FileOutputStream(path);
out = new ObjectOutputStream(fos);
out.writeObject(this);  
...
</code></pre>

<p>And I want to deserialize it when I call the constructor. Is that possible? I've tried several things but they didn't work.</p>

<p>For instance, I've tried:</p>

<pre><code>...
fis = new FileInputStream(path);
in = new ObjectInputStream(fis);
this = (MySerializableClass)in.readObject();
...
</code></pre>

<p>But, of course, <code>this</code> is not a variable that you can assign like that...</p>
