Here you can find the source of getBytes(String hexString)
public static byte[] getBytes(String hexString)
//package com.java2s; public class Main { public static final String HEX_STRING_BLANK_SPLIT = " "; public static byte[] getBytes(String hexString) { String[] hexArray = hexString.split(HEX_STRING_BLANK_SPLIT); byte[] bytes = new byte[hexArray.length]; for (int i = 0; i < hexArray.length; i++) { String hex = hexArray[i]; bytes[i] = Integer.valueOf(hex, 16).byteValue(); }//from w w w . j a v a 2 s .c o m return bytes; } }