//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.Messaging { using System; using System.Diagnostics.Contracts; using System.IO; /// /// An interface implemented by -derived types that support binary serialization. /// [ContractClass(typeof(IStreamSerializingDataBaContract))] internal interface IStreamSerializingDataBag { /// /// Serializes the instance to the specified stream. /// /// The stream. void Serialize(Stream stream); /// /// Initializes the fields on this instance from the specified stream. /// /// The stream. void Deserialize(Stream stream); } /// /// Code Contract for the interface. /// [ContractClassFor(typeof(IStreamSerializingDataBag))] internal abstract class IStreamSerializingDataBaContract : IStreamSerializingDataBag { /// /// Serializes the instance to the specified stream. /// /// The stream. void IStreamSerializingDataBag.Serialize(Stream stream) { Contract.Requires(stream != null); Contract.Requires(stream.CanWrite); throw new NotImplementedException(); } /// /// Initializes the fields on this instance from the specified stream. /// /// The stream. void IStreamSerializingDataBag.Deserialize(Stream stream) { Contract.Requires(stream != null); Contract.Requires(stream.CanRead); throw new NotImplementedException(); } } }