Class ConcurrentHasherRequest
java.lang.Object
com.biglybt.core.util.ConcurrentHasherRequest
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferprivate booleanprivate final intprivate ConcurrentHasherRequestListenerprivate final booleanprivate final intprivate byte[]private final AESemaphoreprivate final intprivate final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConcurrentHasherRequest(ConcurrentHasher _concurrent_hasher, ByteBuffer _buffer, int _hash_version, int _piece_size, long _v2_file_size, ConcurrentHasherRequestListener _listener, boolean _low_priorty) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()cancel the hash request.booleanintbyte[]synchronously get the result of the hash - null returned if it is cancelledintgetSize()booleanprotected voidrun(SHA1Hasher hasher) protected voidrun(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
-