public static byte[] hexStringToByteArray(String s) {
    int len = s.length();
    byte[] data = new byte[len / 2];
    for (int i = 0; i < len; i = i + 2) {
      data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character
          .digit(s.charAt(i + 1), 16));
    }
    return data;
  }
Utility class for dealing with byte strings

@author Stan Love
@version 0.0.1
olv-vfs/src/main/java/net/sf/vfsjfilechooser/accessories/bookmarks/Util.java