Ejemplo n.º 1
0
        public static void Serialize(DataContractObject so, Stream outputStream)
        {
            IDataContractSurrogate dataContractSurrogate = new DataContractActorSurrogate();
            DataContractSerializer dcs = new DataContractSerializer(typeof(DataContractObject), null, 1000, true, true, dataContractSurrogate);

            dcs.WriteObject(outputStream, so);
        }
Ejemplo n.º 2
0
        public static DataContractObject DeSerialize(Stream inputStream)
        {
            CheckArg.Stream(inputStream);
            inputStream.Seek(0, SeekOrigin.Begin);
            IDataContractSurrogate dataContractSurrogate = new DataContractActorSurrogate();
            DataContractSerializer dcs = new DataContractSerializer(typeof(DataContractObject), null, 1000, true, true, dataContractSurrogate);

            return((DataContractObject)dcs.ReadObject(inputStream));
        }