title: How to convert Hex String to binary string with leading zeros?
body: <p>Suppose I have a hex String as <code>0F0A</code>. I need the output as <code>0000111100001010</code>. I tried the following method but this returns <code>111100001010</code> - I need the leading <code>0000</code> as well.</p>
  
  <pre><code>public static String hexToBinary(String hex) {
      return new BigInteger(hex, 16).toString(2);
  }
  </code></pre>