Exemplo n.º 1
0
 /// <summary>
 /// Calculates the byte count needed to encode the UTF-32 bytes from the specified UTF-8 sequence.
 ///
 /// This method will consume as many of the input bytes as possible.
 /// </summary>
 /// <param name="source">A span containing a sequence of UTF-8 bytes.</param>
 /// <param name="bytesNeeded">On exit, contains the number of bytes required for encoding from the <paramref name="source"/>.</param>
 /// <returns>A <see cref="OperationStatus"/> value representing the expected state of the conversion.</returns>
 public static OperationStatus FromUtf8Length(ReadOnlySpan <byte> source, out int bytesNeeded)
 => Utf8.ToUtf32Length(source, out bytesNeeded);