title: How to use HttpClient.GetStreamAsync() method?
body: <p>I am trying to use <code>HttpClient.GetStreamAsync()</code> method to download a file. However there is an issue here. <code>GetStreamAsync()</code> methods returns readonly stream, so i cannot use <code>Length</code> property to declare byte array buffer into which im trying to read bytes.</p>
  
  <pre><code>     using (var file = await _httpClient.GetStreamAsync(url).ConfigureAwait(false))
       {
           // it fails at file.Length below
           byte[] blob = new byte[file.Length];
           await file.ReadAsync(blob, 0, (int)file.Length).ConfigureAwait(false);         
       }
  </code></pre>