title: Converting String Mac Address to Hex
body: <p>I am trying to convert a string macaddress to hex value. I got a  C# code which does the same thing but when I use the java code it gives me negative values. as in the C# code returns signed integer but how do i do the same in Java</p>
  
  <p>following is part of my code</p>
  
  <pre><code>Integer hex = Integer.parseInt(MacAddress.subString(0,2), 16 );
  MacAddress[0] = hex.byteValue();
  </code></pre>
  
  <p>i get something like 148 on the c# code and java returns -148 how can I sort this out thanks</p>
  
  <p>UPDATE </p>
  
  <p>and I just realised that my c# code returns a value of 214 to "D6" a part of the macaddress and the java code returns -42 which is strange</p>