字符串——> 字节数组
getBytes()
举例如下
byte[] b_utf8 = "中".getBytes("UTF-8");
字节数组——> 字符串
new String()
举例如下
String s_utf8 = new String(b_utf8,"UTF-8");
getBytes()
byte[] b_utf8 = "中".getBytes("UTF-8");
new String()
String s_utf8 = new String(b_utf8,"UTF-8");
转载于:https://my.oschina.net/u/3193075/blog/3085314