Methods Summary |
---|
public void | cancel()cancel the hash request. If it is cancelled before it is completed then
a subsequent call to getResult will return null
if ( !cancelled ){
cancelled = true;
sem.releaseForever();
ConcurrentHasherRequestListener listener_copy;
try{
class_mon.enter();
listener_copy = listener;
listener = null;
}finally{
class_mon.exit();
}
if ( listener_copy != null ){
listener_copy.complete( this );
}
}
|
public boolean | getCancelled()
return( cancelled );
|
public byte[] | getResult()synchronously get the result of the hash - null returned if it is cancelled
sem.reserve();
return( result );
|
public int | getSize()
return( size );
|
public boolean | isLowPriority()
return( low_priority );
|
protected void | run(SHA1Hasher hasher)
if ( !cancelled ){
if ( AEDiagnostics.ALWAYS_PASS_HASH_CHECKS ){
result = new byte[0];
}else{
result = hasher.calculateHash( buffer );
}
sem.releaseForever();
if ( !cancelled ){
ConcurrentHasherRequestListener listener_copy;
try{
class_mon.enter();
listener_copy = listener;
listener = null;
}finally{
class_mon.exit();
}
if ( listener_copy != null ){
listener_copy.complete( this );
}
}
}
|