Can Java optimize "mutating" BigInteger operations in loops?
<p>I need to deal with a lot of big numbers much larger than a long (>10^200), so I'm using BigIntegers. The most common operation I perform is adding them to an accumulator, ex:</p>

<pre><code>BigInteger A = new BigInteger("0");
for(BigInteger n : nums) {
    A = A.add(n);
}
</code></pre>

<p>Of course making copies for destructive actions is quite a waste (well, as long as there's a large enough buffer available), so I was wondering if Java can optimize this somehow (I heard there was a MutableBigInteger class not exposed by math.java) or whether I should just write my own BigInteger class.</p>
