byte[] before=new byte[] { (byte)0xf0,0x45,0x00,0x01,0x30,0x31,0x6e,0x31,0x63,0x74,0x6a,0x78,0x62,0x38,0x65,0x74,0x73,0x36,0x6d,0x36,0x6b,0x68,0x73,0x6a,0x67,0x34,0x70,0x64,0x69,0x38,0x68,0x61,0x31,0x69,0x6a,0x66,0x01,0x21,0x01,0x21,0x01,0x21,0x64,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x18,0x09,0x19,0x22,0x03,0x31,0x20,0x18,0x09,0x19,0x21,0x58,0x31};
BASE64Encoder enc=new BASE64Encoder();
String mes=enc.encodeBuffer(before);
System.out.println("mes=="+mes);
做了一个字节数组转字符串的测试,写了个测试类提示这个类不能解析。
查阅资料,找到解决方案:
选择add,下拉框选accessible 下面可以输入 ** ,由于知道这个类在sun下 可以像下面写法