title: 2's complement hex number to decimal in java
body: <p>I have a hex string that represents a 2's complement number. Is there an easy way (libraries/functions) to translate the hex into a decimal without working directly with its bits??</p>
  
  <p>E.G. This is the expected output given the hex on the left:</p>
  
  <pre><code>"0000" =&gt; 0
  "7FFF" =&gt; 32767 (max positive number)
  "8000" =&gt; -32768 (max negative number)
  "FFFF" =&gt; -1
  </code></pre>
  
  <p>Thanks!</p>