語言

Base64.EncodeToUtf8 方法

定義

多載

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

將二進位資料的範圍編碼為UTF-8編碼文字,以64進位表示。

EncodeToUtf8(ReadOnlySpan<Byte>)

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

來源:
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

參數

source
ReadOnlySpan<Byte>
destination
Span<Byte>

傳回

適用於

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

來源:
Base64Encoder.cs
來源:
Base64Encoder.cs
來源:
Base64Encoder.cs
來源:
Base64Encoder.cs
來源:
Base64Encoder.cs

將二進位資料的範圍編碼為UTF-8編碼文字,以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

參數

bytes
ReadOnlySpan<Byte>

輸入區間包含需要編碼的二進位資料。

utf8
Span<Byte>

輸出範圍包含操作結果,即以 64 進制編碼的 UTF-8 文字。

bytesConsumed
Int32

當此方法回傳時,包含操作過程中消耗的輸入位元組數。 若有需要,這可以用來切片後續呼叫的輸入。

bytesWritten
Int32

當此方法回傳時,包含寫入輸出區間的位元組數。 若有需要,這可用來切片後續呼叫的輸出。

isFinalBlock
Boolean

true (預設值)表示輸入區間包含整個需編碼的資料。 false 表示輸入區間包含部分資料,後續會有更多資料。

傳回

其中一個列舉值,用來表示編碼操作的狀態。

備註

回傳值可為如下:

此方法無法回傳,因為 64 進制編碼無法回傳 OperationStatus.InvalidData 。

適用於

EncodeToUtf8(ReadOnlySpan<Byte>)

來源:
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()

參數

source
ReadOnlySpan<Byte>

傳回

Byte[]

適用於