赞
踩
package com.xcx.exam.utils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.IOException;
import java.util.Base64;
/**
@Description: Base64编码测试类 解码前端base64编码格式
@Author: liuxiangpeng
@CreateDate: 2020/4/15 8:54
@UpdateUser: liuxaingpeng
@UpdateDate: 2020/4/15 8:54
@UpdateRemark: 修改内容
@Version: 1.0
*/
public class ImoocBase64 {
public static final String toEncode=“admin”;
/**
jdk8以前
@throws IOException
*/
public static void TestBase64Old() throws IOException {
//编码
BASE64Encoder encoder=new BASE64Encoder();
String encoded = encoder.encode(toEncode.getBytes());
System.out.println(“编码后:”+encoded);
//解码
BASE64Decoder decoder=new
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。