Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Turn's BitTorrent Java library (tracker and client)
Java Shell

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


A Java implementation of the BitTorrent protocol

This is a pure-Java implementation of the BitTorrent protocol, providing a
BitTorrent tracker, a BitTorrent client and the related Torrent metainfo files
creation and parsing capabilities. It is designed to be embedded into larger

This tool suite was implemented as part of Turn's ( release
distribution and deployment system and is used to distribute new build tarballs
to a large number of machines inside a datacenter as efficiently as possible.
At the time this project was started, few Java implementations of the
BitTorrent protocol existed and unfortunately none of them fit our needs:

* Vuze's, which is very hard to extract from their codebase, and thus complex
to re-integrate into another application;
* torrent4j, which is largely incomplete and not usable;
* Snark's, which is old, and unfortunately unstable;
* bitext, which was also unfortunately unstable, and extremely slow.

This implementation aims at providing a down-to-earth, simple to use library.
No fancy protocol extensions are implemented here: just the basics that allows
for the exchange and distribution of files through the BitTorrent protocol.

Although the write performance of the BitTorrent client is currently quite poor
(~10MB/sec/connected peer), it has been measured that the distribution of a
150MB file to thousands of machines across several datacenters took no more
than 30 seconds, with very little network overhead for the initial seeder (only
125% of the original file size uploaded by the initial seeder).


This BitTorrent library is distributed under the terms of the Apache Software
License version 2.0. See COPYING file for more details.


* Maxime Petazzoni <> (Platform Engineer at Turn, Inc)
  - Original author and maintainer
* David Giffin <>
  - Contributed parallel hashing and multi-file torrent support
* Thomas Zink <>
  - Fixed a piece length computation issue when the total torrent size is an
    exact multiple of the piece size.


* Client write performance is a bit poor, mainly due to a (too?) simple piece
  caching algorithm.
* End-game can be slow if the peer selected to retrieve the last piece from
  doesn't upload fast enough (or at all). An end-game scenario should be

Contributions are welcome in all areas, even more so for these few points
Something went wrong with that request. Please try again.