예제 #1
0
 /// <summary>
 /// Writes a sequence to the specified writer.
 /// </summary>
 /// <param name="source">The sequence to be copied.</param>
 /// <param name="writer">The writer to copy to.</param>
 internal static void CopyTo(this ReadOnlySequence <byte> source, ref BufferWriter writer)
 {
     foreach (var segment in source)
     {
         writer.Write(segment.Span);
     }
 }
 /// <summary>
 /// Copies bytes directly into the message pack writer.
 /// </summary>
 /// <param name="rawMessagePackBlock">The span of bytes to copy from.</param>
 public void WriteRaw(ReadOnlySpan <byte> rawMessagePackBlock) => writer.Write(rawMessagePackBlock);