Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/334.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 BitLet的未更改bittorrent库上的NullPointerException_Java_Bittorrent_Torrent - Fatal编程技术网

Java BitLet的未更改bittorrent库上的NullPointerException

Java BitLet的未更改bittorrent库上的NullPointerException,java,bittorrent,torrent,Java,Bittorrent,Torrent,我只是在上面放了个种子,没有修改代码 控制台: Exception in thread "main" java.lang.NullPointerException at org.bitlet.wetorrent.Metafile.<init>(Metafile.java:87) at org.bitlet.wetorrent.Sample.main(Sample.java:35) 在图元文件代码中: 87: byte[] announceByteString = (

我只是在上面放了个种子,没有修改代码

控制台:

Exception in thread "main" java.lang.NullPointerException
    at org.bitlet.wetorrent.Metafile.<init>(Metafile.java:87)
    at org.bitlet.wetorrent.Sample.main(Sample.java:35)
在图元文件代码中:

87: byte[] announceByteString = ((ByteBuffer) rootDictionary.get(ByteBuffer.wrap("announce".getBytes()))).array();
我刚刚得到了开始研究它的源代码,但它没有运行


档案:

  • (图元文件是一个Bencode)
我只更改了一行(来自Sample.java):

发件人:

致:


它从命令行参数中获取torrent文件名,我只是将其放在代码中。

看起来
filename
为空。你能说明你是如何实例化它的吗?请说明被调用的元文件的整个构造函数以及你是如何调用它的。(文件名是什么)快速查看表明此处为null的是
rootDictionary
。请注意,
rootDictionary
不能为
null
,它是
rootDictionary.get(…)
返回
null
,因此在尝试调用
.array()
时会引发异常。我没有任何线索=/
87: byte[] announceByteString = ((ByteBuffer) rootDictionary.get(ByteBuffer.wrap("announce".getBytes()))).array();
String filename = args[0];
String filename = "C:\\Torrents\\Tao Of Jeet Kune Do By Bruce Lee (Pdf,Epub) Gooner.torrent";