Nuclex.Support/Source/Serialization/IBinarySerializable.cs
Markus Ewald ce8df64be5 Imported newly created Nuclex.Support library which contains various supporting classes not related to a specific topic
git-svn-id: file:///srv/devel/repo-conversion/nusu@1 d2e56fa2-650e-0410-a79f-9358c0239efd
2007-02-28 20:20:50 +00:00

28 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
namespace Nuclex.Support.Serialization {
/// <summary>Interface for objects able to serialize themselfes into a binary format</summary>
/// <remarks>
/// Sometimes, the limitations of XML serialization are too strict, especially
/// in the context of a game where you might need to serialize larger chunks of
/// binary data or in cases where you do not wish to expose a default constructor
/// in your classes. This interface defines two simple methods that can be
/// used to load and save an object's state in a simple manner.
/// </remarks>
public interface IBinarySerializable {
/// <summary>Loads the object's state from its serialized representation</summary>
/// <param name="reader">Reader to use for reading the object's state</param>
void Load(BinaryReader reader);
/// <summary>Save the object's state into a serialized representation</summary>
/// <param name="writer">Writer to use for writing the object's state</param>
void Save(BinaryWriter writer);
}
} // namespace Nuclex.Support.Serialization