I have got the String MacAddress, which i need to convert in to a byte array. Java wouldn't let me do a direct conversion throwing a numberformat exception. This is what I'm doing right now
clientMac[0] = (byte)Integer.parseInt(strCameraMacId.substring(0, 2));
I tried doing it step by step
String mc = strCameraMacId.substring(0,2);
int test = Integer.parseInt(mc);
clientMac[0] = (byte) test;
But the String mc consists of a value "08" and after doing the int to byte converion im losing the zero. the mac address im trying to convert is "08-00-23-91-06-48" and I might end up losing all the zeros. will I? and has anyone got an idea regarding how to approach this issue?
Thanks a lot