frostwire / frostwire-jlibtorrent

A swig Java interface for libtorrent by the makers of FrostWire. Develop libtorrent based apps with the joy of coding in Java.
http://www.frostwire.com
MIT License
444 stars 137 forks source link

Can you provide construct method of TorrentInfo #202

Closed waltli closed 6 years ago

waltli commented 6 years ago

Get TorrentInfo object only : public TorrentInfo(File torrent) { this(bdecode0(torrent)); } Please provide two construct method below: public TorrentInfo(InputStream is, long fileSize) { this(bdecode0(is, fileSize)); }

public TorrentInfo(byte[] data) { this(bdecode0(data)); }

Thanks

aldenml commented 6 years ago

I will only add public TorrentInfo(byte[] data), since the one taking an InputStream will be implemented using the one with byte[], I rather the user of the library implement that logic. Btw, this particular class is not for high performance parsing of torrents.

aldenml commented 6 years ago

See https://github.com/frostwire/frostwire-jlibtorrent/commit/ec2324ad3c3b1212e99ba5a4f88f3405f9442bc7

waltli commented 6 years ago

Ok, thank you very much!