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
readerUtf8JsonReader-
The reader to read JSON from.
typeToConvertType-
The type to convert (byte[]).
optionsJsonSerializerOptions-
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
writerUtf8JsonWriter-
The writer to write JSON to.
valuebyte[]-
The byte array to serialize.
optionsJsonSerializerOptions-
Options for the serialization.