将字符串转换为二进制字节数组
/** 来 自 时代Java - N o w J a v a . c o m**/ //package com.nowjava; public class Main { public static void main(String[] argv) throws Exception { String src = "nowjava.com"; System.out.println(java.util.Arrays.toString(asBin(src))); } private static byte[] asBin(String src) { if (src.length() < 1) return null; byte[] encrypted = new byte[src.length() / 2]; for (int i = 0; i < src.length() / 2; i++) { int high = Integer .parseInt(src.substring(i * 2, i * 2 + 1), 16); int low = Integer.parseInt(src.substring(i * 2 + 1, i * 2 + 2)