title: Serializing BigInteger in java
body: <p>I have to write a biginteger into a text file using the following statement.</p>
  
  <pre><code>out.writeObject(n1);
  </code></pre>
  
  <p>where my n1 is a biginteger of length 512 bits.</p>
  
  <p>On reading the same object from the text file gives me a different value to n1. Could anyone help me with the problem. 
  The statement used to read the value is :</p>
  
  <pre><code>in.readObject();
  </code></pre>
  
  <p>Thanks in advance.</p>