/**
* 将字节数组转换成字符串
* @param array 字节数组
* @return String
*/
public static String byte2str(byte[] array){
StringBuffer hexstr = new StringBuffer();
String shaHex = "";
for(int i=0;i<array.length;i++){
shaHex = Integer.toHexString(array[i] & 0xFF);
if(shaHex.length()<2){
hexstr.append(0);
}
hexstr.append(shaHex);
}
return hexstr.toString();
}
原文:http://www.cnblogs.com/wenxudong/p/6232473.html