def _finalize_chunk(self, dd, offsets):
        # type: (Downloader, blobxfer.models.download.Descriptor,
        #        blobxfer.models.download.Offsets) -> None
        """Finalize written chunk
        :param Downloader self: this
        :param blobxfer.models.download.Descriptor dd: download descriptor
        :param blobxfer.models.download.Offsets offsets: offsets
        """
        if dd.entity.is_encrypted:
            dd.mark_unchecked_chunk_decrypted(offsets.chunk_num)
        # integrity check data and write to disk (this is called
        # regardless of md5/hmac enablement for resume purposes)
        dd.perform_chunked_integrity_check()
        # remove from disk set and add bytes to counter
        with self._disk_operation_lock:
            self._disk_set.remove(
                blobxfer.operations.download.Downloader.
                create_unique_disk_operation_id(dd, offsets))
            self._download_bytes_sofar += offsets.num_bytes
Finalize written chunk
        :param Downloader self: this
        :param blobxfer.models.download.Descriptor dd: download descriptor
        :param blobxfer.models.download.Offsets offsets: offsets