mirror of
https://github.com/Rogiel/torrent4j
synced 2025-12-05 23:22:49 +00:00
Fixes compiling issue
This commit is contained in:
32
pom.xml
32
pom.xml
@@ -263,8 +263,8 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>4.0.0.Alpha1-SNAPSHOT</version>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.0.14.Beta1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -284,32 +284,4 @@
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jboss-snapshots</id>
|
||||
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>oss-sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>oss-sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
@@ -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