Broadcasts a progress update.

@param uploadedBytes number of bytes which has been uploaded to the server
@param totalBytes    total bytes of the request
4935
protected final void broadcastProgress(final long uploadedBytes, final long totalBytes) {

        long currentTime = System.currentTimeMillis();
        if (uploadedBytes < totalBytes && currentTime < lastProgressNotificationTime + UploadService.PROGRESS_REPORT_INTERVAL) {
            return;
        }

        setLastProgressNotificationTime(currentTime);

        Logger.debug(LOG_TAG, "Broadcasting upload progress for " + params.id
                + ": " + uploadedBytes + " bytes of " + totalBytes);

        final UploadInfo uploadInfo = new UploadInfo(params.id, startTime, uploadedBytes,
                totalBytes, (attempts - 1),
                successfullyUploadedFiles,
                pathStringListFrom(params.files));

        BroadcastData data = new BroadcastData()
                .setStatus(BroadcastData.Status.IN_PROGRESS)
                .setUploadInfo(uploadInfo);

        final UploadStatusDelegate delegate = UploadService.getUploadStatusDelegate(params.id);
        if (delegate != null) {
            mainThreadHandler.post(new Runnable() {
                @Override
                public void run() {
                    delegate.onProgress(service, uploadInfo);
                }
            });
        } else {
            service.sendBroadcast(data.getIntent());
        }

        updateNotificationProgress(uploadInfo);
    }
1172459
public void setSentBytes(int newSentBytes)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setSentBytes", newSentBytes);
      sentBytes = newSentBytes;
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setSentBytes");
   }
294820
private void updateDate(Date updateDate) {

    if (updateDate != null && (timeStamp == null || updateDate.after(timeStamp))) {
      this.timeStamp = updateDate;
    }
  }
800082
private void onThumbnailUploaded(S3UploadEvent uploadEvent) {
        if (mDeleteAfterUploading) uploadEvent.getFile().delete();
        if (mStream != null) {
            mStream.setThumbnailUrl(uploadEvent.getDestinationUrl());
            sendStreamMetaData();
        }
    }
106817
@Override
    public void sendProgress(Integer msg)
    {
        DbConn cnx = Helpers.getNewDbSession();
        try
        {
            this.ji.setProgress(msg); // Not persisted, but useful to the Loader.
            cnx.runUpdate("jj_update_progress_by_id", msg, ji.getId());
            cnx.commit();
        }
        finally
        {
            Helpers.closeQuietly(cnx);
        }
    }
424113
public void updateCapacityBytes(Map<String, Long> capacityBytesOnTiers) {
    mCapacityBytes = 0;
    mTotalBytesOnTiers = capacityBytesOnTiers;
    for (long t : mTotalBytesOnTiers.values()) {
      mCapacityBytes += t;
    }
  }
80909
public final void increaseReadBytes(long increment, long currentTime) {
        if (increment <= 0) {
            return;
        }

        readBytes += increment;
        lastReadTime = currentTime;
        idleCountForBoth.set(0);
        idleCountForRead.set(0);

//        if (getService() instanceof AbstractIoService) {
//            ((AbstractIoService) getService()).getStatistics().increaseReadBytes(increment, currentTime);
//        }
    }
1001097
@Override
    protected void uploadTusFiles() throws IOException, ProtocolException {
        setState(State.UPLOADING);
        while (uploads.size() > 0) {
            final TusUploader tusUploader;
            // don't recreate uploader if it already exists.
            // this is to avoid multiple connections being open. And to avoid some connections left unclosed.
            if (lastTusUploader != null) {
                tusUploader = lastTusUploader;
                lastTusUploader = null;
            } else {
                tusUploader = tusClient.resumeOrCreateUpload(uploads.get(0));
                if (getUploadChunkSize() > 0) {
                    tusUploader.setChunkSize(getUploadChunkSize());
                }
            }

            TusExecutor tusExecutor = new TusExecutor() {
                @Override
                protected void makeAttempt() throws ProtocolException, IOException {
                    while (state == State.UPLOADING) {
                        int chunkUploaded = tusUploader.uploadChunk();
                        if (chunkUploaded > 0) {
                            uploadedBytes += chunkUploaded;
                            listener.onUploadPogress(uploadedBytes, totalUploadSize);
                        } else {
                            // upload is complete
                            break;
                        }
                    }
                }
            };

            tusExecutor.makeAttempts();
            if (state != State.UPLOADING) {
                // if upload is paused, save the uploader so it can be reused on resume, then leave the method early.
                lastTusUploader = tusUploader;
                return;
            }

            // remove upload instance from list
            uploads.remove(0);
            tusUploader.finish();
        }

        setState(State.UPLOAD_COMPLETE);
    }
120480
protected void updateProgressListener(ProgressListener progressListener, Response response) {
        InputStream responseStream = response.getResponseByteStream();

        int bytesDownloaded = 0;
        long totalBytesExpected = response.getContentLength();
        // Reading 2 KiB at a time to be consistent with the upload segment size in ProgressRequestBody
        final int segmentSize = 2048;

        byte[] responseBytes;
        if (totalBytesExpected > Integer.MAX_VALUE) {
            logger.warn("The response body for " + getUrl() + " is too large to hold in a byte array. Only the first 2 GiB will be available.");
            responseBytes = new byte[Integer.MAX_VALUE];
        }
        else {
            responseBytes = new byte[(int)totalBytesExpected];
        }

        // For every 2 KiB downloaded:
        //      1) Call the user's ProgressListener
        //      2) Append the downloaded bytes into a byte array
        int nextByte;
        try {
            while ((nextByte = responseStream.read()) != -1) {
                if (bytesDownloaded % segmentSize == 0) {
                    progressListener.onProgress(bytesDownloaded, totalBytesExpected);
                }
                responseBytes[bytesDownloaded] = (byte)nextByte;
                bytesDownloaded += 1;
            }
        }
        catch (IOException e) {
            logger.error("IO Exception: " + e.getMessage());
        }

        // Transfer the downloaded data to the Response object so that the user can later retrieve it
        if (response instanceof ResponseImpl) {
            ((ResponseImpl)response).setResponseBytes(responseBytes);
        }
    }
1005346
@Override
    public void updateState(SubscriberState subscriberState) {
        updated.put(subscriberState.getStreamId(), System.currentTimeMillis());
        statusStorageMap.put(subscriberState.getStreamId(), subscriberState);
    }
1169746
@Action(
            semantics = SemanticsOf.IDEMPOTENT,
            publishing = Publishing.ENABLED,
            invokeOn = InvokeOn.COLLECTION_ONLY
    )
    @ActionLayout(
            describedAs = "Publishing enabled, bulk action"
    )
    public void incrementCountInBulk() {
        setCount( currentCount() + 1 );
    }
364770
public void upload(Map<String, ParameterBindingDTO> bindValues) throws BindException
  {
    if (!closed)
    {
      serializeBinds(bindValues);
      putBinds();
    }
  }
1056016
@Override
  public synchronized void onProgressUpdate(float progress) {
    if (mIsFinished) {
      return;
    }
    try {
      onProgressUpdateImpl(progress);
    } catch (Exception e) {
      onUnhandledException(e);
    }
  }
178119
protected void update(long readBytes) throws IOException {
		if (progressListener.isAborted()) {
			throw new IOException("Reading Cancelled by ProgressListener");
		}
		this.bytesRead += readBytes;
		int step = (int)(bytesRead / stepSize);
		if(step > lastStep) {
			lastStep = step;
			progressListener.updateProgress(step, stepNumber);
		}
	}
409016
public void progress(float progress) throws IOException {
    progressValue = progress;
    reporter.progress();
    
    if (recordReader != null) {
      progressKey.set(progress);
      recordReader.next(progressKey, nullValue);
    }
  }
421383
public void update(byte[] buf, int off, int len) throws SignatureException {
        if (RSAdata != null || digestAttr != null)
            messageDigest.update(buf, off, len);
        else
            sig.update(buf, off, len);
    }
46761
public void setByteLimit(int bytes)
    {
        _byteLimit=bytes;
        
        if (bytes>=0)
        {
            _newByteLimit=true;
            _byteLimit-=_contents-_pos;
            if (_byteLimit<0)
            {
                _avail+=_byteLimit;
                _byteLimit=0;
            }
        }
        else
        {
            _newByteLimit=false;
            _avail=_contents;
            _eof=false;
        }
    }