protected override async Task <Stream> GetStream(string path) { var obj = new MemoryStream(); await _client.DownloadObjectAsync(path, obj); obj.Position = 0; return(obj); }
public async Task download_objects() { var fileName = Guid.NewGuid().ToString(); using (var client = new RavenGoogleCloudClient(GoogleCloudFact.GoogleCloudSettings)) { try { await client.UploadObjectAsync( fileName, new MemoryStream(Encoding.UTF8.GetBytes("123")) ); var file = new MemoryStream(); await client.DownloadObjectAsync(fileName, file); Assert.Equal("123", Encoding.ASCII.GetString(file.ToArray())); } finally { await client.DeleteObjectAsync(fileName); } } }
protected override async Task <ZipArchive> GetZipArchive(string filePath) { var file = new MemoryStream(); await _client.DownloadObjectAsync(filePath, file); return(new ZipArchive(file, ZipArchiveMode.Read)); }