Java tutorial
//package com.java2s; public class Main { public static byte[] dehexify(String paramString) { int j = paramString.length(); byte[] arrayOfByte = new byte[j / 2]; int i = 0; while (i < j) { arrayOfByte[(i / 2)] = ((byte) ((Character.digit(paramString.charAt(i), 16) << 4) + Character.digit(paramString.charAt(i + 1), 16))); i += 2; } return arrayOfByte; } }