public static String encodeString(String str) throws Exception{ byte[] encbyte = str.getBytes("UTF8"); return new sun.misc.BASE64Encoder().encode(encbyte); }