Microsoft.OneDrive.Sdk.Helpers.ChunkedUploadProvider.ChunkedUploadProvider C# (CSharp) Method

ChunkedUploadProvider() public method

Helps with resumable uploads. Generates chunk requests based on session information, and can control uploading of requests using client
public ChunkedUploadProvider ( UploadSession session, IBaseClient client, Stream uploadStream, int maxChunkSize = -1 ) : Microsoft.Graph
session UploadSession Session information.
client IBaseClient Client used to upload chunks.
uploadStream Stream Readable, seekable stream to be uploaded. Length of session is determined via uploadStream.Length
maxChunkSize int Max size of each chunk to be uploaded. Multiple of 320 KiB (320 * 1024) is required. /// If less than 0, default value of 5 MiB is used. .
return Microsoft.Graph
        public ChunkedUploadProvider(UploadSession session, IBaseClient client, Stream uploadStream, int maxChunkSize = -1)
        {
            if (!uploadStream.CanRead || !uploadStream.CanSeek)
            {
                throw new ArgumentException("Must provide stream that can read and seek");
            }

            this.Session = session;
            this.client = client;
            this.uploadStream = uploadStream;
            this.rangesRemaining = this.GetRangesRemaining(session);
            this.maxChunkSize = maxChunkSize < 0 ? DefaultMaxChunkSize : maxChunkSize;
            if (this.maxChunkSize % RequiredChunkSizeIncrement != 0)
            {
                throw new ArgumentException("Max chunk size must be a multiple of 320 KiB", nameof(maxChunkSize));
            }
        }