import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.io.IOException;

public class Base64Test {

    public static void main(String[] args) throws IOException {
        BASE64Decoder decoder = new BASE64Decoder();
        BASE64Encoder encoder = new BASE64Encoder();
        String testStr = "你是谁";
        String encoderStr = encoder.encode(testStr.getBytes());
        System.out.println(encoderStr);
        System.out.println(new String(decoder.decodeBuffer(encoderStr)));
    }
}
