Exemplo n.º 1
0
 /// <summary>
 /// Converts a span containing a sequence of UTF-8 bytes into UTF-32 bytes.
 ///
 /// This method will consume as many of the input bytes as possible.
 ///
 /// On successful exit, the entire input was consumed and encoded successfully. In this case, <paramref name="bytesConsumed"/> will be
 /// equal to the length of the <paramref name="source"/> and <paramref name="bytesWritten"/> will equal the total number of bytes written to
 /// the <paramref name="destination"/>.
 /// </summary>
 /// <param name="source">A span containing a sequence of UTF-8 bytes.</param>
 /// <param name="destination">A span to write the UTF-32 bytes into.</param>
 /// <param name="bytesConsumed">On exit, contains the number of bytes that were consumed from the <paramref name="source"/>.</param>
 /// <param name="bytesWritten">On exit, contains the number of bytes written to <paramref name="destination"/></param>
 /// <returns>A <see cref="OperationStatus"/> value representing the state of the conversion.</returns>
 public static OperationStatus FromUtf8(ReadOnlySpan <byte> source, Span <byte> destination, out int bytesConsumed, out int bytesWritten)
 => Utf8.ToUtf32(source, destination, out bytesConsumed, out bytesWritten);