Method Serialize
Serialize()
Serializes an instance into a binary format and returns the resulting data as a byte array.
byte[] Serialize()
Returns
- byte[]
A byte array containing the binary representation of this instance.
Serialize(string)
Serializes this instance into a binary format and writes it to the specified file path. This method converts the current instance into its binary representation and writes the data to a file at the given path.
void Serialize(string path)
Parameters
path
stringThe file path where the serialized data will be written. This path must not be null or empty.
Serialize(Stream)
Serializes this instance into a binary format and writes it to the specified stream.
void Serialize(Stream stream)
Parameters
stream
StreamThe stream to which the serialized data will be written. The stream must be writable and must not be null.