SerializationExtensions

Helpers & Utilities · AiDotNet.Extensions

Provides extension methods for serializing and deserializing data used in AI models.

For Beginners

Serialization is the process of converting data structures or objects into a format that can be stored (in a file or database) or transmitted (across a network). Deserialization is the reverse process.

How It Works

This class provides methods to save your AI model data to files and load them back later. Think of it like saving your progress in a video game so you can continue later.

Methods

Method Summary
T[] ReadArray(BinaryReader reader) Reads an array of type T from a binary stream.
int[] ReadInt32Array(BinaryReader reader) Reads an array of integers from a binary stream.
object ReadValue(BinaryReader reader, Type type) Reads a value of the specified type from a binary stream.
void WriteArray(BinaryWriter writer, T[] array) Writes an array of type T to a binary stream.
void WriteInt32Array(BinaryWriter writer, int[] array) Writes an array of integers to a binary stream.
void WriteValue(BinaryWriter writer, object value) Writes a value of a supported type to a binary stream.