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));
}
}