code: public static byte[] fromHexa(String s ) {
          byte[] ret = new byte[s.length()/2];
          for(int i=0;i<ret.length;i++){
              ret[i] = (byte) Integer.parseInt(s.substring(i*2,i*2+2),16);
          }
          return ret;
      }
docs: Converts hexadecimal string into binary data
  @param s hexadecimal string
  @return binary data
  @throws NumberFormatException in case of string format error