Edit

Share via


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

Definition

Decodes the span of UTF-8 encoded text in base 64 (in-place) into binary data. The decoded binary output is smaller than the text data contained in the input (the operation deflates the data). If the input is not a multiple of 4, the method will not decode any data.

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

Parameters

buffer
Span<Byte>

The input span that contains the base-64 text data that needs to be decoded.

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 decoding operation.

Remarks

The return value can be as follows:

  • OperationStatus.Done: Processing of the entire input span succeeded.
  • OperationStatus.InvalidData: The input contains bytes outside of the expected base 64 range or is incomplete (that is, not a multiple of 4). In .NET 7 and earlier versions, this value can also indicate that the input has invalid or more than two padding characters.

This method cannot return the OperationStatus.DestinationTooSmall and OperationStatus.NeedMoreData values.

Applies to