string和byte[]互相转化

1、byte[]转化为string

byte[] b;
String str = new String(b);

2、String转化为byte

Str s;
byte[] b = s.getBytes();

 

posted @ 2013-08-16 19:45  西瓜君  阅读(495)  评论(0编辑  收藏  举报