Amazon.Runtime.Internal.StreamReadTracker.ReadProgress C# (CSharp) Method

ReadProgress() public method

public ReadProgress ( int bytesRead ) : void
bytesRead int
return void
        public void ReadProgress(int bytesRead)
        {
            if (callback == null)
                return;

            // Invoke the progress callback only if bytes read > 0
            if (bytesRead > 0)
            {
                totalBytesRead += bytesRead;
                totalIncrementTransferred += bytesRead;

                if (totalIncrementTransferred >= this.progressUpdateInterval ||
                    totalBytesRead == contentLength)
                {
                    AWSSDKUtils.InvokeInBackground(
                                        callback,
                                        new StreamTransferProgressArgs(totalIncrementTransferred, totalBytesRead, contentLength),
                                        sender);
                    totalIncrementTransferred = 0;
                }
            }
        }