Table of Contents

Method Deserialize

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

Deserialize(string, LM)

Deserializes the binary data from the specified file path into a DataSource instance using the provided model for context.

public static DataSource Deserialize(string dataSourcePath, LM model)

Parameters

dataSourcePath string

The 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 LM

The model used to assist in the deserialization process, including any 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.

Exceptions

ArgumentNullException

Thrown if dataSourcePath is null or empty.

FileNotFoundException

Thrown if the file specified by dataSourcePath does not exist.

Deserialize(byte[], LM)

Deserializes the given binary data into a DataSource instance using the specified model for context.

public static DataSource Deserialize(byte[] data, LM model)

Parameters

data byte[]

The binary data representing a serialized DataSource. This data must not be null and should be in a valid binary format produced by a corresponding serialize method.

model LM

The model used to assist in the deserialization process, which may include configuration settings or schema definitions needed to correctly rebuild the DataSource instance.

Returns

DataSource

A new instance of DataSource reconstructed from the provided binary data.

Exceptions

ArgumentNullException

Thrown if either data or model is null.

Deserialize(Stream, LM)

Deserializes a DataSource from a stream using the provided model for context.

public static DataSource Deserialize(Stream stream, LM model)

Parameters

stream Stream

The stream containing the binary data of a serialized DataSource. The stream must be readable and must not be null.

model LM

The model used to assist in the deserialization process, which may include settings or definitions essential for reconstructing the DataSource accurately.

Returns

DataSource

A new instance of DataSource reconstructed from the data in the stream.

Exceptions

ArgumentNullException

Thrown if either stream or model is null.

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.