Java中使用Base64编码URL

1

package test;
import org.apache.commons.codec.binary.Base64;

public class Test07 {
    public static void main(String[] args) throws Exception {
        byte[] bytes1 = Base64.encodeBase64("https://blog.csdn.net/qingfengxia2013/article/details/82188912".getBytes());
        String s1 = new String(bytes1);
        System.out.println(s1);

        byte[] bytes = Base64.decodeBase64(s1.getBytes());
        String s2 = new String(bytes);
        System.out.println(s2);
    }
}

posted @ 2020-10-28 17:47  一只桔子2233  阅读(1265)  评论(0)    收藏  举报