2011-07-22 31 views
1

我有一些洪流文件與公佈網址列表f.e.這是它的一部分:解析經過編碼的數據時出現問題?

announce-listll68:http://iptorrents.com:2790/b6d18a815ab4421a86de672d6833369d/announceel67:http://iptorrents.me:2710/b6d18a815ab4421a86de672d6833369d/announceel67:http://iptorrents.ru:6969/b6d18a815ab4421a86de672d6833369d/announceee 

因此,這裏是一個數組,鍵«公佈名單»它包含三個元素(B編碼後的數據,http://en.wikipedia.org/wiki/Bencode)。 所以我使用Aeltis的BDecoder.java類來解碼它。解析時,我得到下一個值的地圖:

{created by=[[email protected], announce=[[email protected], encoding=[[email protected], announce-list=[[[[email protected]], [[[email protected]], [[[email protected]]], comment=[[email protected], creation date=1310060702, info={pieces=[[email protected], name=[[email protected], length=34209795, piece length=65536, private=1}} 

所以宣佈列表中填充了一些散列。那麼如何將它轉換爲普通字符串(例如«http://iptorrents.com:2790/b6d18a815ab4421a86de672d6833369d/announce»)?或者它是BDecoder.java中的一些算法問題?

這是上流的解碼數據的方法:http://pastebin.com/HimqF0ye

回答

1

目的你的情況返回是一個通用的地圖,沒有定義的類型。所以我想當你嘗試打印這些值時,只會打印地址。嘗試將地圖的值轉換爲字符串,並應該做到這一點。

最好的問候,

巴蒂斯特