title: Java: have integer, need it in byte in 0x00 format
body: <p>I have an integer used to seed my for loop:</p>
  
  <pre><code>for(int i = 0; i &lt; value; i++)
  </code></pre>
  
  <p>Within my for loop I am seeding a byte array with byte content values that increment +1. For instance <code>new byte[]{0x00};</code> But the <code>0x00</code> needs to be <code>0x01</code> on the next iteration, how can I convert my value of integer <code>i</code> into a value of byte in the 0x00 format?</p>
  
  <p>I tried things like <code>Byte.valueOf(Integer.toHexString(i))</code> but this just gives me a value that looks like <code>0</code> instead of <code>0x00</code>.</p>