赞
踩
//Original String
String string = "hello world";
//Convert to byte[]
byte[] bytes = string.getBytes();
System.out.println("bytes输出是:"+bytes);
输出如下所示:
bytes输出是:[B@43a0cee9
//Convert back to String
//byte[] bytes
String s = new String(bytes);
//Check converted string against original String
System.out.println("Decoded String : " + s);
输出如下所示:
Decoded String : hello world
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。