TextEncoder.EncodeUtf8 Method

Definition

Encodes the supplied UTF-8 text.

public virtual System.Buffers.OperationStatus EncodeUtf8 (ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true);
abstract member EncodeUtf8 : ReadOnlySpan<byte> * Span<byte> * int * int * bool -> System.Buffers.OperationStatus
override this.EncodeUtf8 : ReadOnlySpan<byte> * Span<byte> * int * int * bool -> System.Buffers.OperationStatus
Public Overridable Function EncodeUtf8 (utf8Source As ReadOnlySpan(Of Byte), utf8Destination As Span(Of Byte), ByRef bytesConsumed As Integer, ByRef bytesWritten As Integer, Optional isFinalBlock As Boolean = true) As OperationStatus

Parameters

utf8Source
ReadOnlySpan<Byte>

A source buffer containing the UTF-8 text to encode.

utf8Destination
Span<Byte>

The destination buffer to which the encoded form of utf8Source will be written.

bytesConsumed
Int32

The number of bytes consumed from the utf8Source buffer.

bytesWritten
Int32

The number of bytes written to the utf8Destination buffer.

isFinalBlock
Boolean

true to indicate there is no further source data that needs to be encoded; otherwise, false.

Returns

A status code that describes the result of the encoding operation.

Remarks

The utf8Source and utf8Destination buffers must not overlap.

Applies to