Example #1
0
 /// <summary>
 /// Calculates the byte count needed to encode the UTF-8 bytes from the specified UTF-16 sequence.
 ///
 /// This method will consume as many of the input bytes as possible.
 /// </summary>
 /// <param name="source">A span containing a sequence of UTF-16 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 FromUtf16Length(ReadOnlySpan <byte> source, out int bytesNeeded)
 => Utf16.ToUtf8Length(source, out bytesNeeded);