Closed AntonAleksandrov13 closed 5 years ago
simply tracks the piece as complete/incomplete:
private final boolean[] complete;
public void setComplete(int pieceIndex, boolean complete) {
this.complete[pieceIndex] = complete;
}
As the name of the class implies "PieceTracker" it's just to track piece status.
Hope this helps.
@gubatron Suppose I am completely new to world of torrents, how should I go about learning how to use your library? Are there any resources that I can use for reference?
You can take a look at the tests: https://github.com/frostwire/frostwire-jlibtorrent/tree/master/src/test/java/com/frostwire/jlibtorrent
You can also take a look at frostwire's source code: https://github.com/frostwire/frostwire/tree/master/common/src/main/java/com/frostwire/bittorrent
And for all documentation on how libtorrent works, the libtorrent documentation is great https://libtorrent.org/reference.html
In this file following line is present:
for (int i = 0; i < numPieces / 2; i++) { tracker.setComplete(i, true); }
I would like some explanation what it actually does, since docs for this method are not present.