title: 16 bit hex string to signed int in Java
body: <p>I have a string in Java representing a signed 16-bit value in HEX. This string can by anything from <code>"0000"</code> to <code>"FFFF"</code>.</p>
  
  <p>I use <code>Integer.parseInt("FFFF",16)</code> to convert it to an integer. However, this returns an unsigned value (<code>65535</code>).</p>
  
  <p>I want it to return a signed value. In this particular example <code>"FFFF"</code> should return <code>-1</code>.</p>
  
  <p>How can I achieve this? Since its a 16-bit value I thought of using <code>Short.parseShort("FFFF",16)</code> but that tells me that I am out of range. I guess <code>parseShort()</code> expects a negative sign.</p>