import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
...
public static String fromBase64(String in) throws IOException {
return new String(new BASE64Decoder().decodeBuffer(in));
}
public static String toBase64(String in) {
return new String(new BASE64Encoder().encodeBuffer(in.getBytes()));
}
No comments:
Post a Comment