-
byte数组转化为String:
- byte [] bMsg = {xx, xx, xx, ……}; //假设编码方式为"UTF-8"
- String str = new String(bMsg, "UTF-8" );
String转化为byte数组:
- String str = "123" ;
-
byte
[] bMsg = str.getBytes(
"UTF-8"
);
//假设编码方式为"UTF-8"
byte数组和String之间的转化
最新推荐文章于 2020-11-09 19:35:52 发布