Edit

Share via


Base64.EncodeToUtf8InPlace(Span<Byte>, Int32, Int32) Method

Definition

Encodes the span of binary data (in-place) into UTF-8 encoded text represented as base 64. The encoded text output is larger than the binary data contained in the input (the operation inflates the data).

public:
 static System::Buffers::OperationStatus EncodeToUtf8InPlace(Span<System::Byte> buffer, int dataLength, [Runtime::InteropServices::Out] int % bytesWritten);
public static System.Buffers.OperationStatus EncodeToUtf8InPlace (Span<byte> buffer, int dataLength, out int bytesWritten);
static member EncodeToUtf8InPlace : Span<byte> * int * int -> System.Buffers.OperationStatus
Public Shared Function EncodeToUtf8InPlace (buffer As Span(Of Byte), dataLength As Integer, ByRef bytesWritten As Integer) As OperationStatus

Parameters

buffer
Span<Byte>

The input span that contains binary data that needs to be encoded. Because the method performs an in-place conversion, it needs to be large enough to store the result of the operation.

dataLength
Int32

The number of bytes of binary data contained within the buffer that needs to be encoded. This value must be smaller than the buffer length.

bytesWritten
Int32

When this method returns, contains the number of bytes written into the buffer.

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.NeedMoreData and OperationStatus.InvalidData.

Applies to