Table of Contents

Class EncodingJsonConverter

Namespace
DatabentoDotNet.Historical.Json
Assembly
DatabentoDotNet.Historical.dll

Reads and writes Encoding as the codec's wire string.

public sealed class EncodingJsonConverter : JsonConverter<Encoding>
Inheritance
EncodingJsonConverter
Inherited Members

Remarks

Needed by Encoding and by nothing else in this library: every other request hard-codes dbn and no other response carries the field. A batch job is the one place a caller chooses, so it is the one place the choice comes back.

dbz — the pre-rename file extension — parses as Dbn and is never written, which is TryParseEncoding(string?, out Encoding)'s behaviour rather than this converter's.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type Encoding.

public override Encoding Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

Encoding

The converted value.

Write(Utf8JsonWriter, Encoding, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, Encoding value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value Encoding

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.