Amazon.S3.Transfer.Internal.DownloadCommand.ByteRangeRemainingForDownload C# (CSharp) Method

ByteRangeRemainingForDownload() static private method

Returns the amount of bytes remaining that need to be pulled down from S3.
static private ByteRangeRemainingForDownload ( string filepath ) : Amazon.S3.Model.ByteRange
filepath string The fully qualified path of the file.
return Amazon.S3.Model.ByteRange
        static ByteRange ByteRangeRemainingForDownload(string filepath)
        {
            /*
             * Initialize the ByteRange as the whole file.
             * long.MaxValue works regardless of the size because
             * S3 will stop sending bits if you specify beyond the
             * size of the file anyways.
             */
            ByteRange byteRange = new ByteRange(0, long.MaxValue);

            if (File.Exists(filepath))
            {
                FileInfo info = new FileInfo(filepath);
                byteRange.Start = info.Length;
            }

            return byteRange;
        }
#endif