byte bytes[] = {0x11, 0x22, 0x33.....};
String str = new String(bytes);

解决方案 »

  1.   

    byte org_Bytes[]={1,2,3};
    byte ret_Bytes[]=new byte[3];
    String ByteStr=new String(org_Bytes);
    System.out.println(ByteStr);
    ret_Bytes=ByteStr.getBytes();
    for(int i=0;i<3;i++)
       System.iut.println(ret_Bytes[i]);
      

  2.   

    public class Hello
    {
    public static void main(String args[])
    {byte bytes[] = {0x11, 0x22, 0x33};
    System.out.println("bytes===="+bytes);
    String tempString = new String (bytes);
    System.out.println("tempString===="+tempString);
    byte[] myByte=tempString.getBytes();
    System.out.println("myByte===="+myByte);
    }}
    C:\>javac  Hello.javaC:\>java   Hello
    bytes====[B@ad3ba4
    tempString===="3
    myByte====[B@26b249C:\>原来是那样
    有问题
    学到点东西
      

  3.   

    byte[] b = "我是王八蛋".getBytes();
            System.out.println(b);
            String s = new BASE64Encoder().encode(b);
            System.out.println(s);
            try{
                System.out.println(new BASE64Decoder().decodeBuffer(s));
            }catch(Exception ex)
            {        }
    结果:
    [B@126b249ztLKx831sMu1sA==[B@19ee1ac
      

  4.   

    import sun.misc.BASE64Encoder;
    import sun.misc.BASE64Decoder;