For
String Encodeing and decodeing using java
import
org.apache.commons.codec.binary.Base64;
public
class
encAndDec {
public
static
void
main(String[] args) {
try
{
String
clearText = "javanotes2all";
String
encodedText;
//
Base64
encodedText
= new
String(Base64.encodeBase64(clearText.getBytes()));
System.out.println("Encoded:
" + encodedText);
System.out.println("Decoded:"
+ new
String(Base64.decodeBase64(encodedText.getBytes())
));
}
catch
(Exception e) {
e.printStackTrace();
}
}
}
download the jar click here.
0 comments:
Post a Comment