2828
2929namespace Amazon . S3 . Transfer
3030{
31+ /// <summary>
32+ /// Specifies the strategy for multipart downloads
33+ /// </summary>
34+ public enum MultipartDownloadType
35+ {
36+ /// <summary>
37+ /// Use part-based downloads with original upload part boundaries
38+ /// </summary>
39+ PART ,
40+
41+ /// <summary>
42+ /// Use range-based downloads with configurable part sizes
43+ /// </summary>
44+ RANGE
45+ }
46+
3147 /// <summary>
3248 /// The base class for requests that return Amazon S3 objects.
3349 /// </summary>
@@ -51,6 +67,10 @@ public abstract class BaseDownloadRequest
5167 private string ifNoneMatch ;
5268 private ResponseHeaderOverrides responseHeaders ;
5369
70+ // Optional part size override (defaults to 8MB per SEP recommendations)
71+ private long ? partSize ;
72+ private MultipartDownloadType multipartDownloadType = MultipartDownloadType . PART ;
73+
5474 /// <summary>
5575 /// Gets or sets the name of the bucket.
5676 /// </summary>
@@ -330,5 +350,46 @@ public ResponseHeaderOverrides ResponseHeaderOverrides
330350 this . responseHeaders = value ;
331351 }
332352 }
353+
354+ /// <summary>
355+ /// Gets or sets the part size of the download in bytes.
356+ /// The downloaded file will be divided into
357+ /// parts the size specified and
358+ /// downloaded from Amazon S3 individually.
359+ /// This is used when MultipartDownloadType is set to RANGE.
360+ /// Default is 8MB per SEP recommendations.
361+ /// </summary>
362+ /// <value>
363+ /// The part size of the download.
364+ /// </value>
365+ public long PartSize
366+ {
367+ get { return this . partSize . GetValueOrDefault ( ) ; }
368+ set { this . partSize = value ; }
369+ }
370+
371+ /// <summary>
372+ /// Checks if PartSize property is set.
373+ /// </summary>
374+ /// <returns>true if PartSize property is set.</returns>
375+ internal bool IsSetPartSize ( )
376+ {
377+ return this . partSize . HasValue ;
378+ }
379+
380+ /// <summary>
381+ /// Gets or sets the type of multipart download to use.
382+ /// PART: Uses part GET with original part sizes from upload (ignores PartSize)
383+ /// RANGE: Uses ranged GET with PartSize to determine ranges
384+ /// Default is PART
385+ /// </summary>
386+ /// <value>
387+ /// The multipart download type.
388+ /// </value>
389+ public MultipartDownloadType MultipartDownloadType
390+ {
391+ get { return this . multipartDownloadType ; }
392+ set { this . multipartDownloadType = value ; }
393+ }
333394 }
334- }
395+ }
0 commit comments