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

◆ ReadLines() [2/2]

LineInfo[] System.Net.Mail.SmtpReplyReaderFactory.ReadLines ( SmtpReplyReader caller,
bool oneLine )
inlinepackage

Definition at line 397 of file SmtpReplyReaderFactory.cs.

398 {
399 if (caller != _currentReader || _readState == ReadState.Done)
400 {
401 return Array.Empty<LineInfo>();
402 }
403 if (_byteBuffer == null)
404 {
405 _byteBuffer = new byte[256];
406 }
409 int num = 0;
410 int num2 = 0;
411 int num3 = 0;
412 while (true)
413 {
414 if (num2 == num3)
415 {
417 num2 = 0;
418 }
420 if (num < 4)
421 {
422 int num5 = Math.Min(4 - num, num4);
423 num += num5;
424 num2 += num5;
425 num4 -= num5;
426 if (num4 == 0)
427 {
428 continue;
429 }
430 }
431 stringBuilder.Append(Encoding.UTF8.GetString(_byteBuffer, num2, num4));
432 num2 += num4;
433 if (_readState == ReadState.Status0)
434 {
435 num = 0;
436 list.Add(new LineInfo(_statusCode, stringBuilder.ToString(0, stringBuilder.Length - 2)));
437 if (oneLine)
438 {
440 return list.ToArray();
441 }
443 }
444 else if (_readState == ReadState.Done)
445 {
446 break;
447 }
448 }
449 list.Add(new LineInfo(_statusCode, stringBuilder.ToString(0, stringBuilder.Length - 2)));
451 return list.ToArray();
452 }
override int Read(byte[] buffer, int offset, int count)
void Push(byte[] buffer, int offset, int count)
unsafe int ProcessRead(byte[] buffer, int offset, int read, bool readLine)
static Encoding UTF8
Definition Encoding.cs:526

References System.Net.Mail.SmtpReplyReaderFactory._bufferedStream, System.Net.Mail.SmtpReplyReaderFactory._byteBuffer, System.Net.Mail.SmtpReplyReaderFactory._currentReader, System.Net.Mail.SmtpReplyReaderFactory._readState, System.Net.Mail.SmtpReplyReaderFactory._statusCode, System.list, System.Math.Min(), System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(), System.Net.BufferedReadStream.Push(), System.Net.BufferedReadStream.Read(), and System.Text.Encoding.UTF8.