개발자愛/JAVA
JAVA base64 incoding decoding
밋첼™
2007. 12. 21. 16:51
public static String base64Decode(String str) {
String result = "";
try {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
byte[] b1 = decoder.decodeBuffer(str);
result = new String(b1);
} catch (IOException ex) {}
return result;
}
public static String base64Encode(String str) {
String result = "";
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
byte[] b1 = str.getBytes();
result = encoder.encode(b1);
return result;
}

Base64EDCoder.zip