Udostępnij za pośrednictwem


AsnWriter.Encode Method

Definition

Overloads

Encode()

Returns a new array containing the encoded value.

Encode(Span<Byte>)

Writes the encoded representation of the data to destination.

Encode<TReturn>(Func<ReadOnlySpan<Byte>,TReturn>)

Provides the encoded representation of the data to the specified callback.

Encode<TState,TReturn>(TState, Func<TState,ReadOnlySpan<Byte>,TReturn>)

Provides the encoded representation of the data to the specified callback.

Encode()

Source:
AsnWriter.cs
Source:
AsnWriter.cs
Source:
AsnWriter.cs
Source:
AsnWriter.cs
Source:
AsnWriter.cs

Returns a new array containing the encoded value.

public:
 cli::array <System::Byte> ^ Encode();
public byte[] Encode();
member this.Encode : unit -> byte[]
Public Function Encode () As Byte()

Returns

Byte[]

A precisely-sized array containing the encoded value.

Exceptions

Applies to

Encode(Span<Byte>)

Source:
AsnWriter.cs
Source:
AsnWriter.cs
Source:
AsnWriter.cs
Source:
AsnWriter.cs
Source:
AsnWriter.cs

Writes the encoded representation of the data to destination.

public:
 int Encode(Span<System::Byte> destination);
public int Encode(Span<byte> destination);
member this.Encode : Span<byte> -> int
Public Function Encode (destination As Span(Of Byte)) As Integer

Parameters

destination
Span<Byte>

The buffer in which to write.

Returns

The number of bytes written to destination.

Exceptions

Applies to

Encode<TReturn>(Func<ReadOnlySpan<Byte>,TReturn>)

Source:
AsnWriter.cs

Provides the encoded representation of the data to the specified callback.

public:
generic <typename TReturn>
 TReturn Encode(Func<ReadOnlySpan<System::Byte>, TReturn> ^ encodeCallback);
public TReturn Encode<TReturn>(Func<ReadOnlySpan<byte>,TReturn> encodeCallback);
member this.Encode : Func<ReadOnlySpan<byte>, 'Return> -> 'Return
Public Function Encode(Of TReturn) (encodeCallback As Func(Of ReadOnlySpan(Of Byte), TReturn)) As TReturn

Type Parameters

TReturn

The type of the return value.

Parameters

encodeCallback
Func<ReadOnlySpan<Byte>,TReturn>

The callback that receives the encoded data.

Returns

TReturn

Returns the value returned from encodeCallback.

Exceptions

encodeCallback is null.

Applies to

Encode<TState,TReturn>(TState, Func<TState,ReadOnlySpan<Byte>,TReturn>)

Source:
AsnWriter.cs

Provides the encoded representation of the data to the specified callback.

public:
generic <typename TState, typename TReturn>
 TReturn Encode(TState state, Func<TState, ReadOnlySpan<System::Byte>, TReturn> ^ encodeCallback);
public TReturn Encode<TState,TReturn>(TState state, Func<TState,ReadOnlySpan<byte>,TReturn> encodeCallback);
member this.Encode : 'State * Func<'State, ReadOnlySpan<byte>, 'Return> -> 'Return
Public Function Encode(Of TState, TReturn) (state As TState, encodeCallback As Func(Of TState, ReadOnlySpan(Of Byte), TReturn)) As TReturn

Type Parameters

TState

The type of the state.

TReturn

The type of the return value.

Parameters

state
TState

The state to pass to encodeCallback.

encodeCallback
Func<TState,ReadOnlySpan<Byte>,TReturn>

The callback that receives the encoded data.

Returns

TReturn

Returns the value returned from encodeCallback.

Exceptions

encodeCallback is null.

Applies to