/**
     * Convert string to bytes for Chinese and other two-byte characters
     */
    public static byte[] stringToBytes(String ss)
    {
     ssLen = ss.length();
        cc = ss.toCharArray();
     ssBuffer = new byte[ssLen*2];
     for(i=0;i<ssLen;i++)
     {
     ssBuffer[i*2+1] = (byte)cc[i];
     ssBuffer[i*2] = (byte)((int)cc[i]>>8); 
     }
     return ssBuffer;
    }    /**
     * Convert bytes to string for Chinese and other two-byte characters
     */
    public static String bytesToString(byte[] ssBuffer, int offset, int length)
    {
     ssLen = (length&0xff)/2;
        cc = new char[ssLen];
     for(i=0;i<ssLen;i++)
     {
         cc[i] = (char)(((ssBuffer[offset+i*2] & 0xff) << 8)  | (ssBuffer[offset+i*2+1] & 0xff));
     }
     return new String(cc);
//     return new String(ssBuffer,offset,length);
    }