Package com.biglybt.core.torrent.impl
Class TOTorrentFileImpl
java.lang.Object
com.biglybt.core.torrent.impl.TOTorrentFileImpl
- All Implemented Interfaces:
TOTorrentFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Mapprivate final longprivate final intprivate static final byteprivate static final byteprivate static final byteprivate byteprivate TOTorrentFileHashTreeImplprivate final intprivate final booleanprivate final intprivate final byte[][]private final byte[][]private byte[]private final TOTorrentImpl -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components) protectedTOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components, byte[][] _path_components_utf8) protectedTOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components, byte[][] _path_components_utf8, byte[] _v2_root_hash) protectedTOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, String _path) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintV2 torrents only - also null for zero length filesintgetIndex()intlongintbyte[][]byte[][]byte[][]Build a relative path based on path components, usingFile.separatorbyte[]booleanis BEP_47 pad fileprotected booleanisUTF8()protected voidsetAdditionalProperty(String name, Object value) protected voidsetRootHash(byte[] _root_hash)
-
Field Details
-
FLAG_BEP47_PAD
private static final byte FLAG_BEP47_PAD- See Also:
-
FLAG_OTHER_PAD
private static final byte FLAG_OTHER_PAD- See Also:
-
FLAG_OTHER_PAD_CHECKED
private static final byte FLAG_OTHER_PAD_CHECKED- See Also:
-
torrent
-
index
private final int index -
file_length
private final long file_length -
path_components
private final byte[][] path_components -
path_components_utf8
private final byte[][] path_components_utf8 -
first_piece_number
private final int first_piece_number -
last_piece_number
private final int last_piece_number -
additional_properties_maybe_null
-
is_utf8
private final boolean is_utf8 -
flags
private byte flags -
hash_tree
-
root_hash
private byte[] root_hash
-
-
Constructor Details
-
TOTorrentFileImpl
protected TOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, String _path) throws TOTorrentException - Throws:
TOTorrentException
-
TOTorrentFileImpl
protected TOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components) throws TOTorrentException - Throws:
TOTorrentException
-
TOTorrentFileImpl
protected TOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components, byte[][] _path_components_utf8) throws TOTorrentException - Throws:
TOTorrentException
-
TOTorrentFileImpl
protected TOTorrentFileImpl(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components, byte[][] _path_components_utf8, byte[] _v2_root_hash) throws TOTorrentException - Throws:
TOTorrentException
-
-
Method Details
-
checkComponents
- Throws:
TOTorrentException
-
getTorrent
- Specified by:
getTorrentin interfaceTOTorrentFile
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceTOTorrentFile
-
getLength
public long getLength()- Specified by:
getLengthin interfaceTOTorrentFile
-
getPathComponentsBasic
public byte[][] getPathComponentsBasic() -
getPathComponents
public byte[][] getPathComponents()- Specified by:
getPathComponentsin interfaceTOTorrentFile
-
getPathComponentsUTF8
public byte[][] getPathComponentsUTF8() -
isUTF8
protected boolean isUTF8() -
setAdditionalProperty
-
getHashTree
Description copied from interface:TOTorrentFileV2 torrents only - also null for zero length files- Specified by:
getHashTreein interfaceTOTorrentFile- Returns:
-
getRootHash
public byte[] getRootHash()- Specified by:
getRootHashin interfaceTOTorrentFile
-
setRootHash
protected void setRootHash(byte[] _root_hash) -
getAdditionalProperties
- Specified by:
getAdditionalPropertiesin interfaceTOTorrentFile
-
getFirstPieceNumber
public int getFirstPieceNumber()- Specified by:
getFirstPieceNumberin interfaceTOTorrentFile
-
getLastPieceNumber
public int getLastPieceNumber()- Specified by:
getLastPieceNumberin interfaceTOTorrentFile
-
getNumberOfPieces
public int getNumberOfPieces()- Specified by:
getNumberOfPiecesin interfaceTOTorrentFile
-
isPadFile
public boolean isPadFile()Description copied from interface:TOTorrentFileis BEP_47 pad file- Specified by:
isPadFilein interfaceTOTorrentFile- Returns:
-
getRelativePath
Description copied from interface:TOTorrentFileBuild a relative path based on path components, usingFile.separator- Specified by:
getRelativePathin interfaceTOTorrentFile
-
serializeToMap
- Since:
- 4.1.0.5
-