public interface DataWorker
Modifier and Type | Method and Description |
---|---|
CompletableFuture<BlockWrite> |
addBlock(TorrentId torrentId,
Peer peer,
int pieceIndex,
int offset,
BufferedData buffer)
Add a write block request.
|
CompletableFuture<BlockRead> |
addBlockRequest(TorrentId torrentId,
Peer peer,
int pieceIndex,
int offset,
int length)
Add a read block request.
|
CompletableFuture<BlockRead> addBlockRequest(TorrentId torrentId, Peer peer, int pieceIndex, int offset, int length)
torrentId
- Torrent IDpeer
- RequestorpieceIndex
- Index of the requested piece (0-based)offset
- Offset in piece to start reading from (0-based)length
- Amount of bytes to readBlockRead.isRejected()
)CompletableFuture<BlockWrite> addBlock(TorrentId torrentId, Peer peer, int pieceIndex, int offset, BufferedData buffer)
torrentId
- Torrent IDpeer
- Peer, that the data has been received frompieceIndex
- Index of the piece to write to (0-based)offset
- Offset in piece to start writing to (0-based)buffer
- DataBlockWrite.isRejected()
)Copyright © 2016–2021. All rights reserved.