byte[] b=...;
String s=new String(b);
或者
String s=new String(b,env);//env:指定的字符编码

解决方案 »

  1.   

    byte[] b = ...;
    String s = new String(b);
      

  2.   

    String(byte[] bytes) 
              Construct a new String by converting the specified array of bytes using the platform's default character encoding.
      

  3.   

    String str = new String(byte[] b,offset,length);
      

  4.   

    byte[] b= 
    String str=b.toString(b);
      

  5.   

    这个问题回答过无数遍了:
    1.你要知道这个byte数租的编码方式:比如"gb2312","big5","utf8"等。
    2.调用String s=new String(b,encoding);
      

  6.   

    这个不好:
    String(byte[] bytes) 
              Construct a new String by converting the specified array of bytes using the platform's default character encoding.如果你一边的Server是英文Windows,把String用Default Encoding变成byte[]
    另一边的Client是中文Windows,用Default Encoding变回String,就会看到乱码