AsnWriter.Encode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Encode() |
Returns a new array containing the encoded value. |
Encode(Span<Byte>) |
Writes the encoded representation of the data to |
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
A precisely-sized array containing the encoded value.
Exceptions
A PushSequence(Nullable<Asn1Tag>) or PushSetOf(Nullable<Asn1Tag>) has not been closed via PopSequence(Nullable<Asn1Tag>) or PopSetOf(Nullable<Asn1Tag>).
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
Returns
The number of bytes written to destination
.
Exceptions
A PushSequence(Nullable<Asn1Tag>) or PushSetOf(Nullable<Asn1Tag>) has not been closed via PopSequence(Nullable<Asn1Tag>) or PopSetOf(Nullable<Asn1Tag>).
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
Returns the value returned from encodeCallback
.
Exceptions
encodeCallback
is null
.
A PushSequence(Nullable<Asn1Tag>) or PushSetOf(Nullable<Asn1Tag>) has not been closed via PopSequence(Nullable<Asn1Tag>) or PopSetOf(Nullable<Asn1Tag>).
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
Returns the value returned from encodeCallback
.
Exceptions
encodeCallback
is null
.
A PushSequence(Nullable<Asn1Tag>) or PushSetOf(Nullable<Asn1Tag>) has not been closed via PopSequence(Nullable<Asn1Tag>) or PopSetOf(Nullable<Asn1Tag>).
Applies to
.NET