Table of Contents

Class ByteArrayConverter

Namespace
VisioForge.Core.VideoFingerPrinting
Assembly
VisioForge.Core.dll

Custom JSON converter for byte arrays that handles binary data serialization and deserialization. Supports reading from Base64 strings, numeric arrays, and null values.

public class ByteArrayConverter : JsonConverter<byte[]>

Inheritance

Inherited Members

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts JSON to a byte array.

public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader to read JSON from.

typeToConvert Type

The type to convert (byte[]).

options JsonSerializerOptions

Options for the serialization.

Returns

byte[]

The deserialized byte array, or null if the JSON token is null.

Exceptions

JsonException

Thrown when an unexpected token type is encountered.

Write(Utf8JsonWriter, byte[], JsonSerializerOptions)

Writes a byte array as JSON.

public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write JSON to.

value byte[]

The byte array to serialize.

options JsonSerializerOptions

Options for the serialization.