org.gudy.azureus2.core3.torrent
Class TOTorrentFactory
java.lang.Object
org.gudy.azureus2.core3.torrent.TOTorrentFactory
public class TOTorrentFactory
- extends java.lang.Object
Method Summary |
static TOTorrentCreator |
createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url)
|
static TOTorrentCreator |
createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes)
|
static TOTorrentCreator |
createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes,
long piece_min_size,
long piece_max_size,
long piece_num_lower,
long piece_num_upper)
|
static TOTorrentCreator |
createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url,
long piece_min_size,
long piece_max_size,
long piece_num_lower,
long piece_num_upper)
|
static TOTorrentCreator |
createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url)
|
static TOTorrentCreator |
createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes)
|
static TOTorrentCreator |
createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes,
long piece_length)
|
static TOTorrentCreator |
createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url,
long piece_length)
|
static TOTorrent |
deserialiseFromBEncodedByteArray(byte[] bytes)
|
static TOTorrent |
deserialiseFromBEncodedFile(java.io.File file)
|
static TOTorrent |
deserialiseFromBEncodedInputStream(java.io.InputStream is)
WARNING - take care if you use this that the data you're creating the torrent from doesn't contain
unwanted attributes in it (e.g. |
static TOTorrent |
deserialiseFromMap(java.util.Map data)
|
static TOTorrent |
deserialiseFromXMLFile(java.io.File file)
|
static long |
getComputedPieceSize(long data_size)
|
static long |
getPieceCount(long total_size,
long piece_size)
|
static long |
getTorrentDataSizeFromFileOrDir(java.io.File file_or_dir_or_desc,
boolean is_layout_descriptor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TO_DEFAULT_FIXED_PIECE_SIZE
public static final long TO_DEFAULT_FIXED_PIECE_SIZE
- See Also:
- Constant Field Values
TO_DEFAULT_VARIABLE_PIECE_SIZE_MIN
public static final long TO_DEFAULT_VARIABLE_PIECE_SIZE_MIN
- See Also:
- Constant Field Values
TO_DEFAULT_VARIABLE_PIECE_SIZE_MAX
public static final long TO_DEFAULT_VARIABLE_PIECE_SIZE_MAX
- See Also:
- Constant Field Values
TO_DEFAULT_VARIABLE_PIECE_NUM_LOWER
public static final long TO_DEFAULT_VARIABLE_PIECE_NUM_LOWER
- See Also:
- Constant Field Values
TO_DEFAULT_VARIABLE_PIECE_NUM_UPPER
public static final long TO_DEFAULT_VARIABLE_PIECE_NUM_UPPER
- See Also:
- Constant Field Values
STANDARD_PIECE_SIZES
public static final long[] STANDARD_PIECE_SIZES
TOTorrentFactory
public TOTorrentFactory()
deserialiseFromBEncodedFile
public static TOTorrent deserialiseFromBEncodedFile(java.io.File file)
throws TOTorrentException
- Throws:
TOTorrentException
deserialiseFromBEncodedInputStream
public static TOTorrent deserialiseFromBEncodedInputStream(java.io.InputStream is)
throws TOTorrentException
- WARNING - take care if you use this that the data you're creating the torrent from doesn't contain
unwanted attributes in it (e.g. "torrent filename"). You should almost definitely be using
TorrentUtils.deserialiseFromBEncodedInputStream
- Parameters:
is
-
- Returns:
-
- Throws:
TOTorrentException
deserialiseFromBEncodedByteArray
public static TOTorrent deserialiseFromBEncodedByteArray(byte[] bytes)
throws TOTorrentException
- Throws:
TOTorrentException
deserialiseFromMap
public static TOTorrent deserialiseFromMap(java.util.Map data)
throws TOTorrentException
- Throws:
TOTorrentException
deserialiseFromXMLFile
public static TOTorrent deserialiseFromXMLFile(java.io.File file)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithFixedPieceLength
public static TOTorrentCreator createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithFixedPieceLength
public static TOTorrentCreator createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithFixedPieceLength
public static TOTorrentCreator createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url,
long piece_length)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithFixedPieceLength
public static TOTorrentCreator createFromFileOrDirWithFixedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes,
long piece_length)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithComputedPieceLength
public static TOTorrentCreator createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithComputedPieceLength
public static TOTorrentCreator createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithComputedPieceLength
public static TOTorrentCreator createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url,
long piece_min_size,
long piece_max_size,
long piece_num_lower,
long piece_num_upper)
throws TOTorrentException
- Throws:
TOTorrentException
createFromFileOrDirWithComputedPieceLength
public static TOTorrentCreator createFromFileOrDirWithComputedPieceLength(java.io.File file,
java.net.URL announce_url,
boolean add_hashes,
long piece_min_size,
long piece_max_size,
long piece_num_lower,
long piece_num_upper)
throws TOTorrentException
- Throws:
TOTorrentException
getTorrentDataSizeFromFileOrDir
public static long getTorrentDataSizeFromFileOrDir(java.io.File file_or_dir_or_desc,
boolean is_layout_descriptor)
throws TOTorrentException
- Throws:
TOTorrentException
getComputedPieceSize
public static long getComputedPieceSize(long data_size)
getPieceCount
public static long getPieceCount(long total_size,
long piece_size)