Class DiskJobWriteBlock

    • Constructor Detail

      • DiskJobWriteBlock

        public DiskJobWriteBlock​(Piece piece,
                                 int blockIndex,
                                 byte[] data,
                                 Consumer<DiskJobWriteBlock> callback)
        Creates a new job to store a block of a piece.
        Parameters:
        piece - The piece in which this block is found
        blockIndex - The index of the block within the given piece.
        data - The bytes to write for the block
        callback - The callback which gets called on completion of this job
    • Method Detail

      • getPiece

        public Piece getPiece()
        Gets the piece for which this store task is being used.
        Returns:
        The piece for which a block is/was being written.
      • getBlockIndex

        public int getBlockIndex()
        Gets the block index within the owning piece.
        Returns:
        The index of the block within the piece.
        See Also:
        getPiece()
      • getPriority

        public int getPriority()
        The priority of this job
        Specified by:
        getPriority in interface IDiskJob
        Returns:
        The priority