public static byte[] stringToByteArray(String s) {
		java.util.Vector<Integer> v = new java.util.Vector<Integer>();
		String operate = new String(s);
		operate = operate.replaceAll(" ", "");
		operate = operate.replaceAll("\t", "");
		operate = operate.replaceAll("\n", "");
		if (operate.endsWith(";"))
			operate = operate.substring(0, operate.length() - 1);
		if (operate.length() % 2 != 0)
			return null;
		int num = 0;
		while (operate.length() > 0) {
			try {
				num = Integer.parseInt(operate.substring(0, 2), 16);
			} catch (NumberFormatException nfe) {
				return null;
			}
			v.add(new Integer(num));
			operate = operate.substring(2);
		}
		byte[] result = new byte[v.size()];
		java.util.Iterator<Integer> it = v.iterator();
		int i = 0;
		while (it.hasNext())
			result[i++] = it.next().byteValue();
		return result;
	}