/// <summary> /// Requests a partial object. You can only add one range request. /// </summary> /// <param name="from"> /// Example: Assume an object with a size of 1000 bytes. /// AddRange(0,499) will return the first 500 bytes (byte offsets 0-499, inclusive). /// AddRange(500,999) will return The second 500 bytes (byte offsets 500-999, inclusive). /// </param> public void AddRange(int from, int to) { if (rangeWasAdded) { throw new InvalidOperationException("S3 only supports a single range specifier."); } WebRequest.AddRange(from, to); rangeWasAdded = true; }
public static void AddRange(this WebRequest webRequest, string rangeSpecifier, int range) { webRequest.AddRange(rangeSpecifier, (long)range); }
public static void AddRange(this WebRequest webRequest, int from, int to) { webRequest.AddRange("bytes", from, to); }
public static void AddRange(this WebRequest webRequest, long from, long to) { webRequest.AddRange("bytes", from, to); }