public class TorrentFileSet extends AbstractFileSet
fileInfos, pieces| Constructor and Description |
|---|
TorrentFileSet(File torrentFile,
File downloadFolder)
Creates a TorrentFileSet instance based upon a .torrent file
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBitfieldBytes()
Gets the have pieces in bitfield format as specified by BEP #3.
|
long |
getPieceSize()
Gets the default piece size
|
void |
setHavingPiece(int pieceIndex)
Adds the have to the bitfield and updates the correct fileInfo have counts
|
countCompletedPieces, countRemainingBytes, getBlockSize, getFileForBytes, getFiles, getNeededPieces, getPiece, getPieceCount, getTotalFileSize, hasPiece, isDonepublic TorrentFileSet(File torrentFile, File downloadFolder)
torrentFile - The metadata file containing the torrent informationdownloadFolder - The folder in which the downloads need to be stored.IllegalArgumentException - When the torrent file is missing or incomplete.public void setHavingPiece(int pieceIndex)
setHavingPiece in class AbstractFileSetpieceIndex - public long getPieceSize()
getPieceSize in class AbstractFileSetpublic byte[] getBitfieldBytes()
throws UnsupportedOperationException
AbstractFileSetgetBitfieldBytes in class AbstractFileSetUnsupportedOperationException - When this implementation doesn't produce the Bitfield as defined in BEP #3.Copyright © 2016. All rights reserved.