未验证 提交 bdc6cacd 编写于 作者: S Stephen Toub 提交者: GitHub

Remove params byte[] from System.Net.Mail (#70513)

上级 9dfbc5bd
......@@ -21,7 +21,7 @@ internal QEncoder(WriteStateInfoBase wsi)
protected override void AppendEncodedCRLF()
{
//the encoding for CRLF is =0D=0A
WriteState.Append((byte)'=', (byte)'0', (byte)'D', (byte)'=', (byte)'0', (byte)'A');
WriteState.Append("=0D=0A"u8);
}
protected override bool LineBreakNeeded(byte b)
......
......@@ -244,7 +244,7 @@ public int EncodeBytes(byte[] buffer, int offset, int count)
if (_encodeCRLF)
{
// The encoding for CRLF is =0D=0A
WriteState.Append((byte)'=', (byte)'0', (byte)'D', (byte)'=', (byte)'0', (byte)'A');
WriteState.Append("=0D=0A"u8);
}
else
{
......
......@@ -77,10 +77,10 @@ internal void Append(byte aByte)
_currentLineLength++;
}
internal void Append(params byte[] bytes)
internal void Append(ReadOnlySpan<byte> bytes)
{
EnsureSpaceInBuffer(bytes.Length);
bytes.CopyTo(_buffer, Length);
bytes.CopyTo(_buffer.AsSpan(Length));
_currentLineLength += bytes.Length;
_currentBufferUsed += bytes.Length;
}
......@@ -90,7 +90,7 @@ internal void AppendCRLF(bool includeSpace)
AppendFooter();
//add soft line break
Append((byte)'\r', (byte)'\n');
Append("\r\n"u8);
_currentLineLength = 0; // New Line
if (includeSpace)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册