Base64的编码和解码

时间:2020-04-24 17:49:14   收藏:0   阅读:60

String str=null;
String encode = new BASE64Encoder().encode(str.getBytes());
System.out.println("编码过后:"+encode);
byte[] bytes = new BASE64Decoder().decodeBuffer(encode);
String decode = new String(bytes, "UTF-8");
System.out.println("解码过后:"+decode);

原文:https://www.cnblogs.com/chenxu1997/p/12768279.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!