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 Map
private final long
private final int
private static final byte
private static final byte
private static final byte
private byte
private TOTorrentFileHashTreeImpl
private final int
private final boolean
private final int
private final long
private final byte[][]
private final byte[][]
private byte[]
private final TOTorrentImpl
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TOTorrentFileImpl
(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components) protected
TOTorrentFileImpl
(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components, byte[][] _path_components_utf8) protected
TOTorrentFileImpl
(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, byte[][] _path_components, byte[][] _path_components_utf8, byte[] _v2_root_hash) protected
TOTorrentFileImpl
(TOTorrentImpl _torrent, int _index, long _torrent_offset, long _len, String _path) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
V2 torrents only - also null for zero length filesint
getIndex()
int
long
int
long
byte[][]
byte[][]
byte[][]
Build a relative path based on path components, usingFile.separator
getRelativePath
(LocaleUtilDecoder decoder) byte[]
boolean
is BEP_47 pad fileprotected boolean
isUTF8()
protected void
setAdditionalProperty
(String name, Object value) protected void
setRootHash
(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 -
offset_in_torrent
private final long offset_in_torrent -
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:
getTorrent
in interfaceTOTorrentFile
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceTOTorrentFile
-
getLength
public long getLength()- Specified by:
getLength
in interfaceTOTorrentFile
-
getOffsetInTorrent
public long getOffsetInTorrent()- Specified by:
getOffsetInTorrent
in interfaceTOTorrentFile
-
getPathComponentsBasic
public byte[][] getPathComponentsBasic() -
getPathComponents
public byte[][] getPathComponents()- Specified by:
getPathComponents
in interfaceTOTorrentFile
-
getPathComponentsUTF8
public byte[][] getPathComponentsUTF8() -
isUTF8
protected boolean isUTF8() -
setAdditionalProperty
-
getHashTree
Description copied from interface:TOTorrentFile
V2 torrents only - also null for zero length files- Specified by:
getHashTree
in interfaceTOTorrentFile
- Returns:
-
getRootHash
public byte[] getRootHash()- Specified by:
getRootHash
in interfaceTOTorrentFile
-
setRootHash
protected void setRootHash(byte[] _root_hash) -
getAdditionalProperties
- Specified by:
getAdditionalProperties
in interfaceTOTorrentFile
-
getFirstPieceNumber
public int getFirstPieceNumber()- Specified by:
getFirstPieceNumber
in interfaceTOTorrentFile
-
getLastPieceNumber
public int getLastPieceNumber()- Specified by:
getLastPieceNumber
in interfaceTOTorrentFile
-
getNumberOfPieces
public int getNumberOfPieces()- Specified by:
getNumberOfPieces
in interfaceTOTorrentFile
-
isPadFile
public boolean isPadFile()Description copied from interface:TOTorrentFile
is BEP_47 pad file- Specified by:
isPadFile
in interfaceTOTorrentFile
- Returns:
-
getRelativePath
Description copied from interface:TOTorrentFile
Build a relative path based on path components, usingFile.separator
- Specified by:
getRelativePath
in interfaceTOTorrentFile
-
getRelativePath
- Specified by:
getRelativePath
in interfaceTOTorrentFile
-
serializeToMap
- Since:
- 4.1.0.5
-