Package com.biglybt.core.torrent.impl
Class TOTorrentFileHashTreeImpl
java.lang.Object
com.biglybt.core.torrent.impl.TOTorrentFileHashTreeImpl
- All Implemented Interfaces:
TOTorrentFileHashTree
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.biglybt.core.torrent.TOTorrentFileHashTree
TOTorrentFileHashTree.HashesReceiver, TOTorrentFileHashTree.HashRequest, TOTorrentFileHashTree.PieceTreeProvider, TOTorrentFileHashTree.PieceTreeReceiver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private final TOTorrentFileImpl
private final int
private static final boolean
private byte[][]
private static final int[]
private Object
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TOTorrentFileHashTreeImpl
(TOTorrentFileImpl _file, byte[] _root_hash) -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<byte[]> addPieceLayer
(byte[] piece_layer) getFile()
protected byte[]
byte[]
protected List
<byte[]> importState
(Map<String, Object> map) boolean
void
receivedHashes
(byte[] root_hash, int base_layer, int index, int length, int proof_layers, byte[][] hashes) boolean
requestHashes
(TOTorrentFileHashTree.PieceTreeProvider piece_tree_provider, TOTorrentFileHashTree.HashesReceiver hashes_receiver, byte[] root_hash, int base_layer, int index, int length, int proof_layers) private boolean
requestHashesSupport
(TOTorrentFileHashTree.PieceTreeProvider piece_tree_provider, TOTorrentFileHashTree.HashesReceiver hashes_receiver, byte[] root_hash, int base_layer, int index, int length, int proof_layers, byte[][] loaded_piece_tree) requestPieceHash
(int piece_number, BitFlags available)
-
Field Details
-
TEST_LEAF_REQUESTS
private static final boolean TEST_LEAF_REQUESTS- See Also:
-
DIGEST_LENGTH
private static final int DIGEST_LENGTH- See Also:
-
BLOCK_SIZE
private static final int BLOCK_SIZE- See Also:
-
pad_hash_cache
-
tree_hash_widths
private static final int[] tree_hash_widths -
file
-
tree_lock
-
tree
private byte[][] tree -
piece_layer_index
private final int piece_layer_index
-
-
Constructor Details
-
TOTorrentFileHashTreeImpl
-
-
Method Details
-
getFile
- Specified by:
getFile
in interfaceTOTorrentFileHashTree
-
getRootHash
public byte[] getRootHash()- Specified by:
getRootHash
in interfaceTOTorrentFileHashTree
-
exportState
-
importState
-
isPieceLayerComplete
public boolean isPieceLayerComplete()- Specified by:
isPieceLayerComplete
in interfaceTOTorrentFileHashTree
-
getPieceLayer
protected byte[] getPieceLayer() -
addPieceLayer
- Throws:
TOTorrentException
-
requestPieceHash
- Specified by:
requestPieceHash
in interfaceTOTorrentFileHashTree
-
receivedHashes
public void receivedHashes(byte[] root_hash, int base_layer, int index, int length, int proof_layers, byte[][] hashes) - Specified by:
receivedHashes
in interfaceTOTorrentFileHashTree
-
requestHashes
public boolean requestHashes(TOTorrentFileHashTree.PieceTreeProvider piece_tree_provider, TOTorrentFileHashTree.HashesReceiver hashes_receiver, byte[] root_hash, int base_layer, int index, int length, int proof_layers) - Specified by:
requestHashes
in interfaceTOTorrentFileHashTree
-
requestHashesSupport
private boolean requestHashesSupport(TOTorrentFileHashTree.PieceTreeProvider piece_tree_provider, TOTorrentFileHashTree.HashesReceiver hashes_receiver, byte[] root_hash, int base_layer, int index, int length, int proof_layers, byte[][] loaded_piece_tree)
-