bt.data.DataDescriptorFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bt-core Show documentation
Show all versions of bt-core Show documentation
BitTorrent Client Library (Core)
package bt.data;
import bt.metainfo.Torrent;
/**
*Note that this class implements a service.
* Hence, is not a part of the public API and is a subject to change.
*/
public class DataDescriptorFactory implements IDataDescriptorFactory {
private ChunkVerifier verifier;
private int transferBlockSize;
public DataDescriptorFactory(ChunkVerifier verifier,
int transferBlockSize) {
this.verifier = verifier;
this.transferBlockSize = transferBlockSize;
}
@Override
public DataDescriptor createDescriptor(Torrent torrent, Storage storage) {
return new DefaultDataDescriptor(storage, torrent, verifier, transferBlockSize);
}
}