System.Net.Http.HttpContent.LoadIntoBufferAsync C# (CSharp) Метод

LoadIntoBufferAsync() публичный Метод

public LoadIntoBufferAsync ( long maxBufferSize ) : System.Threading.Tasks.Task
maxBufferSize long
Результат System.Threading.Tasks.Task
		public async Task LoadIntoBufferAsync (long maxBufferSize)
		{
			if (disposed)
				throw new ObjectDisposedException (GetType ().ToString ());

			if (buffer != null)
				return;

			buffer = CreateFixedMemoryStream (maxBufferSize);
			await SerializeToStreamAsync (buffer, null).ConfigureAwait (false);
			buffer.Seek (0, SeekOrigin.Begin);
		}
		

Same methods

HttpContent::LoadIntoBufferAsync ( ) : System.Threading.Tasks.Task

Usage Example

 private static string ReadContentAsync(HttpContent content)
 {
     Task task = content.LoadIntoBufferAsync();
     task.Wait(TimeoutConstant.DefaultTimeout);
     Assert.Equal(TaskStatus.RanToCompletion, task.Status);
     return content.ReadAsStringAsync().Result;
 }
All Usage Examples Of System.Net.Http.HttpContent::LoadIntoBufferAsync