Exemplo n.º 1
0
 public static void WriteUTF8(this IHFormat format, Span <byte> destination, ReadOnlySpan <char> value, out int bytesWritten)
 {
     if (!format.TryWriteUTF8(destination, value, out bytesWritten))
     {
         ThrowHelper.ThrowIndexOutOfRangeException();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Writes the specified character span to the handler.
 /// </summary>
 /// <param name="value">The span to write.</param>
 public bool AppendFormatted(ReadOnlySpan <char> value)
 {
     if (_format.TryWriteUTF8(_destination.Slice(_position), value, out int bytesWritten))
     {
         _position += bytesWritten;
         return(true);
     }
     return(Fail());
 }