String转byte[]:
String str="hello";
byte[] strByte=str.getBytes();
byte[]转String:
String test=strByte.toString();
String res = new String(srtByte);
test不是"hello"
res是"hello"
String转byte[]:
String str="hello";
byte[] strByte=str.getBytes();
byte[]转String:
String test=strByte.toString();
String res = new String(srtByte);
test不是"hello"
res是"hello"
本文标题:Java中byte[]和String的转换问题
本文链接:https://www.haomeiwen.com/subject/qlhaoftx.html
网友评论