Package com.biglybt.core.util
Class ConcurrentHasherRequest
- java.lang.Object
-
- com.biglybt.core.util.ConcurrentHasherRequest
-
public class ConcurrentHasherRequest extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer
buffer
private boolean
cancelled
private int
hash_version
private ConcurrentHasherRequestListener
listener
private boolean
low_priority
private int
piece_size
private byte[]
result
private AESemaphore
sem
private int
size
private long
v2_file_size
private java.util.List<java.util.List<byte[]>>
v2_hash_tree
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConcurrentHasherRequest(ConcurrentHasher _concurrent_hasher, java.nio.ByteBuffer _buffer, int _hash_version, int _piece_size, long _v2_file_size, ConcurrentHasherRequestListener _listener, boolean _low_priorty)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
cancel the hash request.boolean
getCancelled()
java.util.List<java.util.List<byte[]>>
getHashTree()
int
getHashVersion()
byte[]
getResult()
synchronously get the result of the hash - null returned if it is cancelledint
getSize()
boolean
isLowPriority()
protected void
run(SHA1Hasher hasher)
protected void
run(java.security.MessageDigest hasher)
-
-
-
Field Detail
-
hash_version
private final int hash_version
-
buffer
private final java.nio.ByteBuffer buffer
-
piece_size
private final int piece_size
-
v2_file_size
private final long v2_file_size
-
v2_hash_tree
private java.util.List<java.util.List<byte[]>> v2_hash_tree
-
listener
private ConcurrentHasherRequestListener listener
-
size
private final int size
-
result
private byte[] result
-
cancelled
private boolean cancelled
-
low_priority
private final boolean low_priority
-
sem
private final AESemaphore sem
-
-
Constructor Detail
-
ConcurrentHasherRequest
protected ConcurrentHasherRequest(ConcurrentHasher _concurrent_hasher, java.nio.ByteBuffer _buffer, int _hash_version, int _piece_size, long _v2_file_size, ConcurrentHasherRequestListener _listener, boolean _low_priorty)
-
-
Method Detail
-
getHashVersion
public int getHashVersion()
-
getResult
public byte[] getResult()
synchronously get the result of the hash - null returned if it is cancelled- Returns:
-
getHashTree
public java.util.List<java.util.List<byte[]>> 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
protected void run(SHA1Hasher hasher)
-
run
protected void run(java.security.MessageDigest hasher)
-
-