Advertisement
rraito

Base64 Encode and DECODE JAVA

Apr 18th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Base64 Encode
  2.  
  3. Base64 Decode
  4.  
  5. String test = "Nyaruko";
  6. String lalu_siapa = Base64.encodeToString(test.getBytes(),
  7. Base64.DEFAULT);
  8. Log.d("",lalu_siapa );
  9. byte[] bytes = Base64.decode(lalu_siapa,
  10. Base64.DEFAULT);
  11. try {
  12. lalu_siapa = new String(bytes, "UTF-8");
  13. } catch (UnsupportedEncodingException e1) {
  14. // TODO Auto-generated catch block
  15. e1.printStackTrace();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement