50,530
社区成员
发帖
与我相关
我的任务
分享
//正确的结果
String strOriginal = "csdn xxxx";
byte[] in = strOriginal.getBytes();
byte[] out= myUtils.encode(in);
byte[] deout = myUtils.decode(out);
String strDecode = new String(deout);
Log.e(TAG, strDecode);
//错误的结果
String strOriginal = "csdn xxxx";
byte[] in = strOriginal.getBytes();
byte[] out= myUtils.encode(in);
String strEncode = new String(out); //字节数组转换成String后格式好像变了
byte[] deout = myUtils.decode(strEncode.getBytes());
String strDecode = new String(deout);
Log.e(TAG, strDecode);