예제 #1
0
        public static Stream GetS3ReadStream(IS3Client s3Client, string bucketName, string fileName, long position)
        {
            var connector = ConnectUtilities.GetS3ConnectFunc(bucketName, fileName, s3Client);
            var stream    = ConnectUtilities.ConnectWithRetries(connector, position, MaxRetryCount);

            return(new PersistentStream(stream, connector, position));
        }
예제 #2
0
        public static Stream GetReadStream(string location, long position = 0)
        {
            if (string.IsNullOrEmpty(location))
            {
                return(null);
            }
            if (!ConnectUtilities.IsHttpLocation(location))
            {
                return(File.Exists(location) ? FileUtilities.GetReadStream(location) : null);
            }

            var connector = ConnectUtilities.GetHttpConnectFunc(location);
            var stream    = ConnectUtilities.ConnectWithRetries(connector, position, MaxRetryCount);

            return(new PersistentStream(stream, connector, position));
        }