title: Java print four byte hexadecimal number
body: <p>I have a small problem. I have numbers like 5421, -1 and 1. I need to print them in four bytes, like:</p>
  
  <pre><code>5421 -&gt; 0x0000152D
  -1   -&gt; 0xFFFFFFFF
  1    -&gt; 0x00000001
  </code></pre>
  
  <p>Also, I have floating point numbers like 1.2, 58.654:</p>
  
  <pre><code>8.25f -&gt; 0x41040000
  8.26  -&gt; 0x410428f6
  0.7   -&gt; 0x3f333333
  </code></pre>
  
  <p>I need convert both types of numbers into their hexadecimal version, but they must be exactly four bytes long (four pairs of hexadecimal digits). </p>
  
  <p>Does anybody know how is this possible in Java? Please help. </p>