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

◆ Read() [2/2]

override int System.Net.Http.HttpConnection.ContentLengthReadStream.Read ( Span< byte > buffer)
inlinevirtual

Reimplemented from System.Net.Http.HttpBaseStream.

Definition at line 537 of file HttpConnection.cs.

538 {
539 if (_connection == null || buffer.Length == 0)
540 {
541 return 0;
542 }
543 if ((ulong)buffer.Length > _contentBytesRemaining)
544 {
545 buffer = buffer.Slice(0, (int)_contentBytesRemaining);
546 }
547 int num = _connection.Read(buffer);
548 if (num <= 0)
549 {
551 }
552 _contentBytesRemaining -= (ulong)num;
554 {
556 _connection = null;
557 }
558 return num;
559 }
int Read(Span< byte > destination)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_http_invalid_response_premature_eof_bytecount
Definition SR.cs:98
Definition SR.cs:7

References System.Net.Http.HttpContentStream._connection, System.Net.Http.HttpConnection.ContentLengthReadStream._contentBytesRemaining, System.buffer, System.Net.Http.HttpConnection.CompleteResponse(), System.SR.Format(), System.L, System.SR.net_http_invalid_response_premature_eof_bytecount, and System.Net.Http.HttpConnection.Read().