mirror of
https://github.com/Rogiel/torrent4j
synced 2025-12-06 07:32:47 +00:00
Fixes compiling issue
This commit is contained in:
@@ -6,5 +6,13 @@ package com.torrent4j.model.peer;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public enum TorrentPeerInterest {
|
||||
INTERESTED, NOT_INTERESTED;
|
||||
/**
|
||||
* Determines that the peer is interest in any piece from the other peer.
|
||||
*/
|
||||
INTERESTED,
|
||||
|
||||
/**
|
||||
* Determines that the peer is NOT interest in any piece from the other peer.
|
||||
*/
|
||||
NOT_INTERESTED;
|
||||
}
|
||||
@@ -3,11 +3,26 @@ package com.torrent4j.model.peer;
|
||||
import java.util.BitSet;
|
||||
|
||||
import com.torrent4j.model.AbstractTorrentPiecesContainer;
|
||||
import com.torrent4j.net.peerwire.messages.BitFieldMessage;
|
||||
import com.torrent4j.net.peerwire.messages.HaveMessage;
|
||||
|
||||
|
||||
/**
|
||||
* This class represents a set of pieces that a given peer has on their side.
|
||||
* Please note that some peers make use of a delayed bitfield, which sets random
|
||||
* pieces of the bitfield set on {@link BitFieldMessage} and the rest is
|
||||
* received with {@link HaveMessage}s. This is called "lazy bitfield".
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class TorrentPeerPieces extends AbstractTorrentPiecesContainer {
|
||||
private final TorrentPeer peer;
|
||||
|
||||
|
||||
/**
|
||||
* Loads an existing bitset to this container
|
||||
*
|
||||
* @param bitSet
|
||||
* the bitset
|
||||
*/
|
||||
public void load(BitSet bitSet) {
|
||||
this.bitSet.set(0, this.bitSet.size(), false);
|
||||
for (int i = bitSet.nextSetBit(0); i >= 0; i = bitSet.nextSetBit(i + 1)) {
|
||||
|
||||
Reference in New Issue
Block a user