コード例 #1
0
ファイル: WindowsService.cs プロジェクト: gspike/HostR
		private byte[] DownloadUpdate(WindowsServiceUpdate update)
		{
			// Get the file from the deployment service.
			var data = new byte[update.Size];
			var request = new WindowsServiceUpdateRequest { Name = update.Name, Offset = 0 };

			// Read the whole file.
			while (request.Offset < data.Length)
			{
				var chunk = _client.DownloadUpdateChunk(request);
				Array.Copy(chunk, 0, data, request.Offset, chunk.Length);
				request.Offset += chunk.Length;
			}

			// Return the data read.
			return data;
		}