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

◆ WriteBytesSlowAsync()

async Task System.Net.Http.HttpConnection.WriteBytesSlowAsync ( byte[] bytes,
int length,
bool async )
inlineprivate

Definition at line 2038 of file HttpConnection.cs.

2039 {
2040 int offset = 0;
2041 while (true)
2042 {
2043 int val = length - offset;
2044 int num = Math.Min(val, _writeBuffer.Length - _writeOffset);
2045 Buffer.BlockCopy(bytes, offset, _writeBuffer, _writeOffset, num);
2046 _writeOffset += num;
2047 offset += num;
2048 if (offset != length)
2049 {
2050 if (_writeOffset == _writeBuffer.Length)
2051 {
2053 _writeOffset = 0;
2054 }
2055 continue;
2056 }
2057 break;
2058 }
2059 }
ValueTask WriteToStreamAsync(ReadOnlyMemory< byte > source, bool async)
ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext)
Definition ValueTask.cs:312

References System.Net.Http.HttpConnection._writeBuffer, System.Net.Http.HttpConnection._writeOffset, System.Buffer.BlockCopy(), System.bytes, System.Threading.Tasks.ValueTask< TResult >.ConfigureAwait(), System.length, System.Math.Min(), System.offset, and System.Net.Http.HttpConnection.WriteToStreamAsync().

Referenced by System.Net.Http.HttpConnection.WriteBytesAsync(), and System.Net.Http.HttpConnection.WriteStringWithEncodingAsyncSlow().