Rune.TryEncodeToUtf8(Span<Byte>, Int32) Metod

Definition

Kodar detta Rune till en UTF-8-kodad målbuffert.

public:
 bool TryEncodeToUtf8(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten);
member this.TryEncodeToUtf8 : Span<byte> * int -> bool
Public Function TryEncodeToUtf8 (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

Parametrar

destination
Span<Byte>

Bufferten som utf-8-kodat värde ska skrivas till.

bytesWritten
Int32

Antalet Byte värden som skrivs till destination, eller 0 om målbufferten inte är tillräckligt stor för att innehålla utdata.

Returer

trueom värdet skrevs till bufferten. annars . false

Kommentarer

Egenskapen Utf8SequenceLength kan frågas i förväg för att fastställa buffertens destination storlek.

Gäller för