/** * Convert a string with hex values in a byte array. * * @param in * @return the array */ public static byte[] fromBinaryString(String in) { byte[] out = new byte[ in.length() / 2 ]; for ( int i = 0; i < out.length; i++ ) out[i] = hexToByte( in, i*2 ); return out; }