51

Are there any decent BitTorrent libraries for Java? I need to program a simple torrent client, but it would be great if I didn't have to write everything from scratch.

samulisoderlund
  • 888
  • 2
  • 12
  • 18

7 Answers7

32

Turn's TTorrent is a pure Java bit torrent library.

chamakits
  • 1,865
  • 1
  • 17
  • 26
leonm
  • 6,454
  • 30
  • 38
  • 3
    [Etsy uses ttorrent](http://codeascraft.com/2012/01/23/solr-bittorrent-index-replication/) for Solr index replication. – Ryan May 29 '13 at 21:36
  • 1
    As of 2017 it's for the most part abandoned and unmaintained. For everyone interested in Java BitTorrent I'd suggest checking out Bt, a modern Java 8 BitTorrent library: https://github.com/atomashpolskiy/bt . It includes: PEX, magnet links, DHT, message stream encryption, extended protocol. As a bonus it has clear and concise API and JavaDoc and, being built with Guice DI, provides vast possibilities for extension/customization. – Andrei Tomashpolskiy Jul 26 '17 at 14:21
  • There are important nuances that need to know. Ttorrent - does not support DHT. BT library - supported, only Android 8+ – Master Mar 28 '20 at 19:23
23

Snark by Three Rings is a very lightweight bitorrent library that will give you basic torrent features.

Was originally written by Mark Wielaard. A github source can be found here https://github.com/akerigan/born-again-snark

Community
  • 1
  • 1
jjnguy
  • 136,852
  • 53
  • 295
  • 323
6

I have created a Bitlet Fork on Github.

It's LGPLed, and it's running faster than ttorent.

Eric Platon
  • 9,819
  • 6
  • 41
  • 48
Toilal
  • 3,301
  • 1
  • 24
  • 32
4

Azureus (now named Vuze) gives you a plugin API. Using this API you can plug your code into Azureus. Start it inside your program, and listen/respond to its events.

Tim Abell
  • 11,186
  • 8
  • 79
  • 110
Anonymous
  • 41
  • 1
3

Azureus is written in Java - is most likely not "simple" but quite likely "decent" :)

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • 5
    But is it a library - does it offer APIs that you can easily use in your own programs? – Jonik Jun 03 '09 at 13:37
1

Adding to answer from jjnguy : The code seems to be at http://code.google.com/p/snark/ and not in the repo pointed to in the link you've provided.

I've not used it, but a Google search showed up YAIRCC. Describes itself as "A lightweight Java Bittorrent library and client".

Anirudh
  • 388
  • 3
  • 9
-1

Transdroid and Transdroid-desktop are libraries for adroid, that can also be used in java to control existing torrent clients.

Mateu
  • 2,636
  • 6
  • 36
  • 54