Interface IFileSetRequestFactory
-
public interface IFileSetRequestFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IMessagecreateCancelRequestFor(Peer peer, Piece piece, int byteOffset, int length)Creates a cancelIMessagefor a earlier send out request.IMessagecreateRequestFor(Peer peer, Piece piece, int byteOffset, int length)Creates a request to download the given piece block.booleansupportsCancellation()
-
-
-
Method Detail
-
createRequestFor
IMessage createRequestFor(Peer peer, Piece piece, int byteOffset, int length)
Creates a request to download the given piece block.- Parameters:
peer- The peer for which this request is being constructed.piece- The piece to request.byteOffset- The offset within the piece.length- The length of the block to request.- Returns:
- The
IMessagewhich will request the block. - See Also:
createCancelRequestFor(Peer, Piece, int, int)
-
createCancelRequestFor
IMessage createCancelRequestFor(Peer peer, Piece piece, int byteOffset, int length)
Creates a cancelIMessagefor a earlier send out request.- Parameters:
peer-piece- The piece to cancel the request for.byteOffset- The offset within the piece.length- The length of the block which was requested.- Returns:
- The
IMessageto cancel the request, ornullifsupportsCancellation()returnsfalse. - See Also:
createRequestFor(Peer, Piece, int, int)
-
supportsCancellation
boolean supportsCancellation()
- Returns:
- Returns
truewhen a request created bycreateRequestFor(Peer, Piece, int, int)can be cancelled. - See Also:
createCancelRequestFor(Peer, Piece, int, int)
-
-