Amazon.Glacier.Transfer.Internal.MultipartUploadCommand.CalculatePartSize C# (CSharp) Метод

CalculatePartSize() статический приватный Метод

Calculates the part size to use when uploading an archive of the specified size using Glacier's multipart upload APIs. Because of the tree hashing algorithm, part sizes must be aligned on 2^n MB boundaries (ex: 1MB, 2MB, 4MB, 8MB, etc). All parts must be the same size, except for the last part.
static private CalculatePartSize ( long fileSize ) : long
fileSize long The size of the file being uploaded.
Результат long
        internal static long CalculatePartSize(long fileSize)
        {
            long partSize = MINIMUM_PART_SIZE;
            int approxNumParts = 1;
	        while (partSize * approxNumParts < fileSize && partSize*2 <= MAXIMUM_PART_SIZE) 
            {
                partSize *= 2;
                approxNumParts *= 2;
            }
	
            return partSize;        
        }
    }