Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadAsStream() [2/2]

Stream System.Net.Http.HttpContent.ReadAsStream ( CancellationToken cancellationToken)
inlineinherited

Definition at line 366 of file HttpContent.cs.

367 {
369 ArraySegment<byte> buffer;
370 if (_contentReadStream == null)
371 {
372 return (Stream)(_contentReadStream = (TryGetBuffer(out buffer) ? new MemoryStream(buffer.Array, buffer.Offset, buffer.Count, writable: false) : CreateContentReadStream(cancellationToken)));
373 }
374 if (_contentReadStream is Stream result)
375 {
376 return result;
377 }
378 throw new HttpRequestException(System.SR.net_http_content_read_as_stream_has_task);
379 }
virtual Stream CreateContentReadStream(CancellationToken cancellationToken)
bool TryGetBuffer(out ArraySegment< byte > buffer)
static string net_http_content_read_as_stream_has_task
Definition SR.cs:50
Definition SR.cs:7

References System.Net.Http.HttpContent._contentReadStream, System.buffer, System.cancellationToken, System.Net.Http.HttpContent.CheckDisposed(), System.Net.Http.HttpContent.CreateContentReadStream(), System.SR.net_http_content_read_as_stream_has_task, and System.Net.Http.HttpContent.TryGetBuffer().