String(byte[] ascii, int hibyte) 
          Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the String constructors that take a charset name or that use the platform's default charset. String(byte[] ascii, int hibyte, int offset, int count) 
          Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the String constructors that take a charset name or that use the platform's default charset. 

解决方案 »

  1.   

    不知道byte可以不可以,我觉得应该可以吧。字节就是构成文件的最低元素了。用
    String类的getBytes()方法就可以把String拆成byte.然后你再对BYTE进行加密行么?
      

  2.   

    如用String类的getBytes()方法就可以把String拆成byte,
    这个函数在那个包下?
    望告知!谢先
      

  3.   

    //转过去char temChr ;
      int ascChr ;
      int i ;
      String ss = "" ;
      String rtStr = "地从" ;
      int length = rtStr.length() ;
      for ( i = 0 ; i < length ; i++ )
      {
       temChr = rtStr.charAt( i ) ;
       ascChr = temChr + 0 ;
       ss = ss + "&#x" + Integer.toHexString( ascChr ) + ";" ;//转回来String sArray[] = ss.split(";");
    byte   bArray[] = new byte[2 * sArray.length];
    for (i = 0 ; i < sArray.length; i++) {
        try {
            int tmp = Integer.parseInt(sArray[i].substring(3), 16);
            System.out.println(">>>>>int value is " + sArray[i].substring(3));
            bArray[i*2 + 1] = (byte)(tmp & 0xff); 
            bArray[i*2    ] = (byte)((tmp >> 8) & 0xff); 
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
    }
    System.out.println("convert to orginal String is " + new String(bArray));
      

  4.   

    这个完成了!!谢谢
    散分~!
    那如何将byte转换为String类型?????????????????????解决后散分
      

  5.   

    byte[] b;
    String a=new String(b);
    你便可以得到转换后的String,这个方法简单又方便。