JDK 8之后的版本中针对sun.misc.BASE64Encoder 使用方法进行了修改升级,
JDK 8中:
BASE64Decoder decoder = new BASE64Decoder();
byte[] bytes = decoder.decodeBuffer(str);
BASE64Decoder decoder = new BASE64Decoder();
byte[] bytes = decoder.decodeBuffer(str);
JDK 11中变更为:
Base64.Decoder decoder = Base64.getMimeDecoder();
byte[] bytes = decoder.decode(str);
Base64.Decoder decoder = Base64.getMimeDecoder();
byte[] bytes = decoder.decode(str);