title: Java BigInteger toByteArray specify number of bytes to use
body: <p>I was wondering it there is any way to specify how many bytes to use when creating the byte array using toByteArray method. For example:</p>
  <pre><code>BigInteger bigInteger = new BigInteger(&quot;-12&quot;);
  </code></pre>
  <p>I want <code>bigInteger.toByteArray()</code> to return an array with values <code>FF</code> and <code>F4</code> (assuming that the value is represented using 4 bytes - short variable, but it returns only <code>F4</code>.</p>