Package com.biglybt.core.util
Class ConcurrentHasherRequest
java.lang.Object
com.biglybt.core.util.ConcurrentHasherRequest
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBuffer
private boolean
private final int
private ConcurrentHasherRequestListener
private final boolean
private final int
private byte[]
private final AESemaphore
private final int
private final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ConcurrentHasherRequest
(ConcurrentHasher _concurrent_hasher, ByteBuffer _buffer, int _hash_version, int _piece_size, long _v2_file_size, ConcurrentHasherRequestListener _listener, boolean _low_priorty) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
cancel the hash request.boolean
int
byte[]
synchronously get the result of the hash - null returned if it is cancelledint
getSize()
boolean
protected void
run
(SHA1Hasher hasher) protected void
run
(MessageDigest hasher)
-
Field Details
-
hash_version
private final int hash_version -
buffer
-
piece_size
private final int piece_size -
v2_file_size
private final long v2_file_size -
v2_hash_tree
-
listener
-
size
private final int size -
result
private byte[] result -
cancelled
private boolean cancelled -
low_priority
private final boolean low_priority -
sem
-
-
Constructor Details
-
ConcurrentHasherRequest
protected ConcurrentHasherRequest(ConcurrentHasher _concurrent_hasher, ByteBuffer _buffer, int _hash_version, int _piece_size, long _v2_file_size, ConcurrentHasherRequestListener _listener, boolean _low_priorty)
-
-
Method Details
-
getHashVersion
public int getHashVersion() -
getResult
public byte[] getResult()synchronously get the result of the hash - null returned if it is cancelled- Returns:
-
getHashTree
-
cancel
public void cancel()cancel the hash request. If it is cancelled before it is completed then a subsequent call to getResult will return null -
getCancelled
public boolean getCancelled() -
getSize
public int getSize() -
isLowPriority
public boolean isLowPriority() -
run
-
run
-