ISerializerExtensions
Provides extension methods for the ISerializer and ISerializer<T> interfaces to support serialization and deserialization operations with files, streams, and byte arrays.
Métodos
public static object Deserialize(ISerializer serializer, byte[] data)
result = ISerializerExtensions.Deserialize(serializer, data)
Deserializes the specified byte array into an object.
- serializer
- The serializer instance.
- data
- The byte array containing the serialized data.
Devuelve: The deserialized object.
public static object Deserialize(ISerializer serializer, Stream stream)
result = ISerializerExtensions.Deserialize(serializer, stream)
Deserializes the data from the given stream into an object.
- serializer
- The serializer instance.
- stream
- The stream containing the serialized data.
Devuelve: The deserialized object.
public static object Deserialize(ISerializer serializer, IFileSystem fs, string path)
result = ISerializerExtensions.Deserialize(serializer, fs, path)
Deserializes the data from the specified file into an object using the provided file system.
- serializer
- The serializer instance.
- fs
- The file system to use.
- path
- The path of the file to read from.
Devuelve: The deserialized object.
public static T Deserialize<T>(ISerializer<T> serializer, IFileSystem fs, string path)
result = ISerializerExtensions.Deserialize(serializer, fs, path)
Deserializes the data from the specified file into an object of type T using the provided file system.
- serializer
- The serializer instance.
- fs
- The file system to use.
- path
- The path of the file to read from.
Devuelve: An object of type T.
public static T Deserialize<T>(ISerializer<T> serializer, byte[] data)
result = ISerializerExtensions.Deserialize(serializer, data)
Deserializes the specified byte array into an object of type T.
- serializer
- The serializer instance.
- data
- The byte array containing the serialized data.
Devuelve: An object of type T.
public static T Deserialize<T>(ISerializer<T> serializer, Stream stream)
result = ISerializerExtensions.Deserialize(serializer, stream)
Deserializes the data from the given stream into an object of type T.
- serializer
- The serializer instance.
- stream
- The stream containing the serialized data.
Devuelve: An object of type T.
public static void Serialize(ISerializer serializer, object graph, IFileSystem fs, string path)
ISerializerExtensions.Serialize(serializer, graph, fs, path)
Serializes the specified object graph and writes the output to a file using the provided file system.
- serializer
- The serializer instance.
- graph
- The object graph to serialize.
- fs
- The file system to use.
- path
- The path of the file to write to.
public static byte[] Serialize(ISerializer serializer, object graph)
result = ISerializerExtensions.Serialize(serializer, graph)
Serializes the specified object graph and returns the result as a byte array.
- serializer
- The serializer instance.
- graph
- The object graph to serialize.
Devuelve: A byte array containing the serialized data.
public static void Serialize(ISerializer serializer, object graph, Stream stream)
ISerializerExtensions.Serialize(serializer, graph, stream)
Serializes the specified object graph and writes the output to the provided stream.
- serializer
- The serializer instance.
- graph
- The object graph to serialize.
- stream
- The stream to which to write the serialized data.