Edit

Share via


Base64.EncodeToUtf8 Method

Definition

Overloads

Name Description
EncodeToUtf8(ReadOnlySpan<Byte>, Span<Byte>)
EncodeToUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean)

Encodes the span of binary data into UTF-8 encoded text represented as base 64.

EncodeToUtf8(ReadOnlySpan<Byte>)

EncodeToUtf8(ReadOnlySpan<Byte>, Span<Byte>)

Source:
Base64Encoder.cs
public:
 static int EncodeToUtf8(ReadOnlySpan<System::Byte> source, Span<System::Byte> destination);
public static int EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination);
static member EncodeToUtf8 : ReadOnlySpan<byte> * Span<byte> -> int
Public Shared Function EncodeToUtf8 (source As ReadOnlySpan(Of Byte), destination As Span(Of Byte)) As Integer

Parameters

source
ReadOnlySpan<Byte>
destination
Span<Byte>

Returns

Applies to

EncodeToUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean)

Source:
Base64Encoder.cs
Source:
Base64Encoder.cs
Source:
Base64Encoder.cs
Source:
Base64Encoder.cs
Source:
Base64Encoder.cs

Encodes the span of binary data into UTF-8 encoded text represented as base 64.

public static System.Buffers.OperationStatus EncodeToUtf8(ReadOnlySpan<byte> bytes, Span<byte> utf8, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true);
static member EncodeToUtf8 : ReadOnlySpan<byte> * Span<byte> * int * int * bool -> System.Buffers.OperationStatus
Public Shared Function EncodeToUtf8 (bytes As ReadOnlySpan(Of Byte), utf8 As Span(Of Byte), ByRef bytesConsumed As Integer, ByRef bytesWritten As Integer, Optional isFinalBlock As Boolean = true) As OperationStatus

Parameters

bytes
ReadOnlySpan<Byte>

The input span that contains binary data that needs to be encoded.

utf8
Span<Byte>

The output span that contains the result of the operation, that is, the UTF-8 encoded text in base 64.

bytesConsumed
Int32

When this method returns, contains the number of input bytes consumed during the operation. This can be used to slice the input for subsequent calls, if necessary.

bytesWritten
Int32

When this method returns, contains the number of bytes written into the output span. This can be used to slice the output for subsequent calls, if necessary.

isFinalBlock
Boolean

true (the default) to indicate that the input span contains the entire data to encode. false to indicate that the input span contains partial data with more data to follow.

Returns

One of the enumeration values that indicates the status of the encoding operation.

Remarks

The return value can be as follows:

This method cannot return OperationStatus.InvalidData since that is not possible for base-64 encoding.

Applies to

EncodeToUtf8(ReadOnlySpan<Byte>)

Source:
Base64Encoder.cs
public:
 static cli::array <System::Byte> ^ EncodeToUtf8(ReadOnlySpan<System::Byte> source);
public static byte[] EncodeToUtf8(ReadOnlySpan<byte> source);
static member EncodeToUtf8 : ReadOnlySpan<byte> -> byte[]
Public Shared Function EncodeToUtf8 (source As ReadOnlySpan(Of Byte)) As Byte()

Parameters

source
ReadOnlySpan<Byte>

Returns

Byte[]

Applies to