Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java eclipse中的Base64错误_Java_Eclipse - Fatal编程技术网

Java eclipse中的Base64错误

Java eclipse中的Base64错误,java,eclipse,Java,Eclipse,我已经下载了org.apache.commons.codec 1.9,并将jar文件导入到我的项目中,添加了导入声明,但是我得到了一个错误 是代码中的错误还是我没有正确导入jar import org.apache.commons.codec.binary.Base64; 在org.apache.commons.codec 1.9中,Base64类没有任何名为encodeBytes的静态方法 请参阅完整的文档 以下是可从上述链接进行编码/解码的方法: decodeBase64(byte[] b

我已经下载了org.apache.commons.codec 1.9,并将jar文件导入到我的项目中,添加了导入声明,但是我得到了一个错误

是代码中的错误还是我没有正确导入jar

import org.apache.commons.codec.binary.Base64;
在org.apache.commons.codec 1.9中,Base64类没有任何名为encodeBytes的静态方法

请参阅完整的文档

以下是可从上述链接进行编码/解码的方法:

decodeBase64(byte[] base64Data)
decodeBase64(String base64String)
decodeInteger(byte[] pArray)
encodeBase64(byte[] binaryData)
encodeBase64(byte[] binaryData, boolean isChunked)
encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe)
encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe, int maxResultSize)
encodeBase64Chunked(byte[] binaryData)
encodeBase64String(byte[] binaryData)
encodeBase64URLSafe(byte[] binaryData)
encodeBase64URLSafeString(byte[] binaryData)

您可能希望查看您的使用情况,并为您的使用选择相关的方法。

Base64的1.9版没有encodeBytes方法。我想你要找的是。

错误消息是什么?@user1898898当然,没问题