Packages that use Piece
Package
Description
I2P version of the Snark BitTorrent client, enhanced for I2P: peers are I2P destinations, torrents can be served anonymously as hidden services, and metadata carries I2P-specific comment fields.
  • Uses of Piece in org.klomp.snark

    Classes in org.klomp.snark that implement interfaces with type arguments of type Piece
    Modifier and Type
    Class
    Description
    (package private) class 
    Represents a torrent piece and tracks which peers have it and are requesting it.
    Fields in org.klomp.snark declared as Piece
    Modifier and Type
    Field
    Description
    private final Piece
    PartialPiece.piece
    The piece being filled in.
    (package private) final Piece
    PeerCoordinator.StalledPiece.piece
    The piece that stalled.
    Fields in org.klomp.snark with type parameters of type Piece
    Modifier and Type
    Field
    Description
    private final Map<Integer,Piece>
    PeerCoordinator.wantedMap
    Index of wantedPieces by piece id, for O(1) lookups.
    private final List<Piece>
    PeerCoordinator.wantedPieces
    The wanted pieces.
    Methods in org.klomp.snark that return Piece
    Modifier and Type
    Method
    Description
    private Piece
    PeerCoordinator.wantPiece(Peer peer, BitField havePieces, boolean record)
    Returns one of pieces in the given BitField that is still wanted or null if none of the given pieces are wanted.
    private Piece
    PeerCoordinator.wantPiece(Peer peer, BitField havePieces, boolean record, Set<Integer> allowed)
    Returns one of the claimed pieces in the given BitField that is still wanted or null if none of the given pieces are wanted.
    Methods in org.klomp.snark with parameters of type Piece
    Modifier and Type
    Method
    Description
    int
    Piece.compareTo(Piece op)
    Compares by highest priority first, then by rarest first.
    private void
    PeerCoordinator.expireStalledPiece(Piece p, Set<PeerID> requesters)
    Cancels the outstanding requests for a stalled piece and returns its partial data to the partial piece list, so the piece can be re-requested from other peers.
    (package private) static boolean
    PeerCoordinator.isStalled(Piece p, long now, long timeout)
    Checks if the piece has been requested but has received no data for longer than the timeout.
    Constructors in org.klomp.snark with parameters of type Piece
    Modifier
    Constructor
    Description
    PartialPiece(Piece piece, int len, File tempDir)
    A PartialPiece for the given piece with the specified length.
    PartialPiece(Piece piece, int len, File tempDir, MetaInfo meta)
    A PartialPiece for the given piece with the specified length.
    (package private)
    StalledPiece(Piece piece, Set<PeerID> requesters)
    Records one stalled piece.