FubarDev.FtpServer.FileSystem.OneDrive.OneDriveFileSystem.OpenReadAsync C# (CSharp) Method

OpenReadAsync() public method

public OpenReadAsync ( IUnixFileEntry fileEntry, long startPosition, CancellationToken cancellationToken ) : Task
fileEntry IUnixFileEntry
startPosition long
cancellationToken System.Threading.CancellationToken
return Task
        public async Task<Stream> OpenReadAsync(IUnixFileEntry fileEntry, long startPosition, CancellationToken cancellationToken)
        {
            var from = startPosition != 0 ? (long?)startPosition : null;
            var fileItem = ((OneDriveFileEntry)fileEntry).Item;
            var response = await Service.GetDownloadResponseAsync(Drive.Id, fileItem.Id, from, cancellationToken);
            return new OneDriveDownloadStream(this, fileItem, response, startPosition, fileEntry.Size);
        }