public static char[] hexToBytes(String hexString){
  char[] result=new char[hexString.length() / 2];
  for (int i=0; i < hexString.length(); i+=2) {
    result[i / 2]=(char)Integer.parseInt(hexString.substring(i,i + 2),16);
  }
  return (result);
}

public static char [ ] hexToBytes ( String hexString ) { char [ ] result = new char [ hexString . length ( ) / 2 ] ; for ( int i = 0 ; i < hexString . length ( ) ; i += 2 ) { result [ i / 2 ] = ( char ) Integer . parseInt ( hexString . substring ( i , i + 2 ) , 16 ) ; } return ( result ) ; }
convert hexadecimal string to array of bytes each byte is represented by 2 characters in hex string
