public interface ChunkDescriptor extends BlockSet
A chunk is a part of the torrent's collection of files, possibly overlapping several files (in case of multi-file torrents) or being just a part of a single-file torrent.
There is a SHA-1 checksum for each chunk in the torrent's metainfo file,
so it's effectively an elementary unit of data in BitTorrent.
All chunks in a given torrent have the same size
(determined by Torrent.getChunkSize()
),
except for the last one, which can be smaller.
A typical chunk is usually too large to work with at I/O level. So, for the needs of network transfer and storage each chunk is additionally split into "blocks". Size of a block is quite an important parameter of torrent messaging, and it's usually client-specific (meaning that each client is free to choose the concrete value).
Modifier and Type | Method and Description |
---|---|
byte[] |
getChecksum()
Expected hash of this chunk's contents as indicated in torrent file.
|
DataRange |
getData()
Get chunk's data accessor.
|
blockCount, blockSize, clear, isComplete, isEmpty, isPresent, lastBlockSize, length
byte[] getChecksum()
DataRange getData()
Copyright © 2016–2021. All rights reserved.