MimeKit.MimeMessage.DkimWriteHeaderSimple C# (CSharp) Method

DkimWriteHeaderSimple() static private method

static private DkimWriteHeaderSimple ( MimeKit.FormatOptions options, Stream stream, Header header, bool isDkimSignature ) : void
options MimeKit.FormatOptions
stream Stream
header Header
isDkimSignature bool
return void
		static void DkimWriteHeaderSimple (FormatOptions options, Stream stream, Header header, bool isDkimSignature)
		{
			var rawValue = header.GetRawValue (options);
			int rawLength = rawValue.Length;

			if (isDkimSignature && rawLength > 0) {
				if (rawValue[rawLength - 1] == (byte) '\n') {
					rawLength--;

					if (rawLength > 0 && rawValue[rawLength - 1] == (byte) '\r')
						rawLength--;
				}
			}

			stream.Write (header.RawField, 0, header.RawField.Length);
			stream.Write (new [] { (byte) ':' }, 0, 1);
			stream.Write (rawValue, 0, rawLength);
		}