Dela via


NrbfDecoder.Decode Method

Definition

Overloads

Decode(Stream, PayloadOptions, Boolean)

Decodes the provided NRBF payload.

Decode(Stream, IReadOnlyDictionary<SerializationRecordId,SerializationRecord>, PayloadOptions, Boolean)

Decodes the provided NRBF payload.

Decode(Stream, PayloadOptions, Boolean)

Source:
NrbfDecoder.cs
Source:
NrbfDecoder.cs

Decodes the provided NRBF payload.

public static System.Formats.Nrbf.SerializationRecord Decode (System.IO.Stream payload, System.Formats.Nrbf.PayloadOptions? options = default, bool leaveOpen = false);
static member Decode : System.IO.Stream * System.Formats.Nrbf.PayloadOptions * bool -> System.Formats.Nrbf.SerializationRecord
Public Shared Function Decode (payload As Stream, Optional options As PayloadOptions = Nothing, Optional leaveOpen As Boolean = false) As SerializationRecord

Parameters

payload
Stream

The NRBF payload.

options
PayloadOptions

Options to control behavior during parsing.

leaveOpen
Boolean

true to leave payload payload open after the reading is finished; otherwise, false.

Returns

A SerializationRecord that represents the root object. It can be either PrimitiveTypeRecord<T>, a ClassRecord or an ArrayRecord.

Exceptions

payload is null.

payload does not support reading or is already closed.

Reading from payload encounters invalid NRBF data.

An I/O error occurred.

Reading from payload encounters not supported records. For example, arrays with non-zero offset or not supported record types (ClassWithMembers, SystemClassWithMembers, MethodCall or MethodReturn).

Reading from payload encounters an invalid UTF8 sequence.

The end of the stream is reached before reading MessageEnd record.

Applies to

Decode(Stream, IReadOnlyDictionary<SerializationRecordId,SerializationRecord>, PayloadOptions, Boolean)

Source:
NrbfDecoder.cs
Source:
NrbfDecoder.cs

Decodes the provided NRBF payload.

public static System.Formats.Nrbf.SerializationRecord Decode (System.IO.Stream payload, out System.Collections.Generic.IReadOnlyDictionary<System.Formats.Nrbf.SerializationRecordId,System.Formats.Nrbf.SerializationRecord> recordMap, System.Formats.Nrbf.PayloadOptions? options = default, bool leaveOpen = false);
static member Decode : System.IO.Stream * IReadOnlyDictionary * System.Formats.Nrbf.PayloadOptions * bool -> System.Formats.Nrbf.SerializationRecord
Public Shared Function Decode (payload As Stream, ByRef recordMap As IReadOnlyDictionary(Of SerializationRecordId, SerializationRecord), Optional options As PayloadOptions = Nothing, Optional leaveOpen As Boolean = false) As SerializationRecord

Parameters

payload
Stream

The NRBF payload.

recordMap
IReadOnlyDictionary<SerializationRecordId,SerializationRecord>

When this method returns, contains a mapping of SerializationRecordId to the associated serialization record. This parameter is treated as uninitialized.

options
PayloadOptions

An object that describes optional PayloadOptions parameters to use.

leaveOpen
Boolean

true to leave payload payload open after the reading is finished; otherwise, false.

Returns

A SerializationRecord that represents the root object. It can be either PrimitiveTypeRecord<T>, a ClassRecord or an ArrayRecord.

Applies to