Here you can find the source of fromHex(String s)
public static byte[] fromHex(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] fromHex(String s) { byte bs[] = new byte[s.length() / 2]; for (int i = 0; i < bs.length; i++) bs[i] = (byte) Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16); return bs; }/*from w w w. j a va2s . co m*/ }