Method Deserialize
Deserialize(string, LLM)
Deserializes the binary data from the specified file path into a DataSource instance using the provided model for context. This method reconstructs a DataSource object from its binary form, applying the model to interpret or configure the data appropriately.
public static DataSource Deserialize(string dataSourcePath, LLM model)
Parameters
dataSourcePath
stringThe path to the binary file containing the serialized DataSource. The path must not be null or empty, and the file should be in a valid binary format produced by a corresponding serialization method.
model
LLMThe model used to assist in the deserialization process, including configuration settings or schema definitions necessary for correctly rebuilding the DataSource instance.
Returns
- DataSource
A new instance of DataSource reconstructed from the provided binary data. Returns null if deserialization fails.
Exceptions
- ArgumentNullException
Thrown if
dataSourcePath
is null or empty.- FileNotFoundException
Thrown if the file specified by
dataSourcePath
does not exist.
Deserialize(byte[], LLM)
Deserializes the given binary data into a DataSource instance using the specified model for context.
This method reconstructs a DataSource object from its binary form, applying the model to interpret or configure the data appropriately.
public static DataSource Deserialize(byte[] data, LLM model)
Parameters
data
byte[]The binary data representing a serialized DataSource. This data must not be null and should be a valid binary format previously produced by a corresponding serialize method.
model
LLMThe model used to assist in the deserialization process. This might include configuration settings or schema definitions needed to correctly rebuild the DataSource instance.
Returns
- DataSource
A new instance of DataSource that has been reconstructed from the provided binary data. Returns null if deserialization fails.
Exceptions
- ArgumentNullException
Thrown if either
data
ormodel
is null.
Deserialize(Stream, LLM)
Deserializes a DataSource from a stream using the provided model for context.
This method reconstructs a DataSource object from its binary form, applying the model to interpret or configure the data appropriately.
public static DataSource Deserialize(Stream stream, LLM model)
Parameters
stream
StreamThe stream containing the binary data of a serialized DataSource. The stream must be readable and must not be null.
model
LLMThe model used to assist in the deserialization process, which may include settings or definitions essential for reconstructing the DataSource accurately. This parameter must not be null.
Returns
- DataSource
A new instance of DataSource reconstructed from the data in the stream. If deserialization fails, it may return null or throw an exception, depending on the failure condition.
Exceptions
- ArgumentNullException
Thrown if either
stream
ormodel
is null, as both are required for successful deserialization.- ArgumentException
Thrown if the stream is not readable.
- InvalidDataException
Thrown when the data in the stream does not represent a valid serialized DataSource, or if errors occur during the deserialization process.