Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Decode

abstract virtual func Decode(source: ReadOnlySlice<byte>, final: bool) -> Result<string, EncodingError>

Declaring type: Decoder
Module: System.Text
Assembly: System.Runtime.dll
Source file: Decoder.rvn

Defined by Decoder.Decode · Required implementation (no default).

Interface implementation: Required implementation (no default).

Decodes a borrowed byte window, copying incomplete scalars into owned state.

Parameters

Name Type Description
source ReadOnlySlice<Byte> Readonly input view, reusable after return; built-ins accept at most 65536 bytes.
final Boolean Whether this is the last input; incomplete trailing sequences are rejected.

Return value

Result<String, EncodingError>

Completed text, possibly empty, or LimitExceeded, InvalidUtf8, InvalidData or Finished.

Remarks

The source is not retained. A successful call accepts the entire view. Quota failures leave decoder state unchanged. Malformed input and finalization end the session. Invalid window construction faults before this call. Built-ins preserve BOMs and never replace invalid bytes.