Struct DecodingContext
Represents text decoding context.
Namespace: DotNext.Text
Assembly: DotNext.dll
Syntax
public struct DecodingContext
Remarks
The context represents a decoding cache to avoid memory allocations for each round of string decoding caused by methods of StreamExtensions class.
Constructors
| Improve this Doc View SourceDecodingContext(Encoding, Boolean)
Initializes a new decoding context.
Declaration
public DecodingContext(Encoding encoding, bool reuseDecoder = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Encoding | encoding | The encoding to be used for converting bytes into string. |
| Boolean | reuseDecoder | true to reuse the decoder between decoding operations; false to create separated encoder for each encoding operation. |
Properties
| Improve this Doc View SourceEncoding
Gets encoding associated with this context.
Declaration
public Encoding Encoding { get; }
Property Value
| Type | Description |
|---|---|
| Encoding |
Methods
| Improve this Doc View SourceReset()
Sets the encapsulated decoder to its initial state.
Declaration
public void Reset()
Operators
| Improve this Doc View SourceImplicit(Encoding to DecodingContext)
Creates decoding context
Declaration
public static implicit operator DecodingContext(Encoding encoding)
Parameters
| Type | Name | Description |
|---|---|---|
| Encoding | encoding | The text encoding. |
Returns
| Type | Description |
|---|---|
| DecodingContext |