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
following is part of my code
Integer hex = Integer.parseInt(MacAddress.subString(0,2), 16 );
MacAddress[0] = hex.byteValue();
i get something like 148 on the c# code and java returns -148 how can I sort this out thanks
UPDATE
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