Class ConcurrentHasherRequest


  • public class ConcurrentHasherRequest
    extends java.lang.Object
    • 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
      • size

        private final int size
      • result

        private byte[] result
      • cancelled

        private boolean cancelled
      • low_priority

        private final boolean low_priority
    • 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​(java.security.MessageDigest hasher)