警告:com.sun.org.apache.xerces.internal.impl.dv.util.Base64 是 Sun 的专用 API,可能会在未来版本中删除
这个问题在编译时出现问题,请问该怎么解决?
------解决方案--------------------
没事 可以正常使用的 你不升级JDK就ok! 这个只是警告 不是错误
------解决方案--------------------
把代码扣出来自己写一个吧
// Copyright (C) 1999-2002 by Jason Hunter <jhunter_AT_acm_DOT_org>.
// All rights reserved. Use of this class is limited.
// Please see the LICENSE for more information.
package org.apache.commons.mvc.util;
import java.io.*;
/***
* A class to encode Base64 streams and strings.
* See RFC 1521 section 5.2 for details of the Base64 algorithm.
* <p>
* This class can be used for encoding strings:
* <blockquote><pre>
* String unencoded = "webmaster:try2gueSS";
* String encoded = Base64Encoder.encode(unencoded);
* </pre></blockquote>
* or for encoding streams:
* <blockquote><pre>
* OutputStream out = new Base64Encoder(System.out);
* </pre></blockquote>
*
* @author <b>Jason Hunter</b>, Copyright © 2000
* @version 1.2, 2002/11/01, added encode(byte[]) method to better handle
* binary data (thanks to Sean Graham)
* @version 1.1, 2000/11/17, fixed bug with sign bit for char values
* @version 1.0, 2000/06/11
*/
public class Base64Encoder extends FilterOutputStream {
private static final char[] chars = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '+', '/'
};
private int charCount;
private int carryOver;
/***
* Constructs a new Base64 encoder that writes output to the given
* OutputStream.
*
* @param out the output stream
*/
public Base64Encoder(OutputStream out) {