title: Java int to hex with 0x
body: <p>I'm trying to convert int to hex with format 0x12 0x2B and so on. Is there anything similar like python: <a href="https://docs.python.org/2/library/functions.html#hex" rel="nofollow noreferrer">https://docs.python.org/2/library/functions.html#hex</a>
  to accomplish this or i will need to work around this with many unnecessary steps?</p>
  
  <p>I need to get something like this below:</p>
  
  <pre><code>int []hexInt={0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01}; 
  </code></pre>