예제 #1
0
 public object Deserialize(Stream dataStream, Stream infoStream)
 {
     _reader        = new BinaryReader(dataStream);
     _serializeInfo = (SerializerInfo)_formatter.Deserialize(infoStream);
     _serializeInfo.InitId2Object();
     return(ReadObject());
 }
예제 #2
0
        public object Deserialize(Stream dataStream)
        {
            _reader = new BinaryReader(dataStream);
            _reader.BaseStream.Position = _reader.BaseStream.Length - 4;
            int infoLen = _reader.ReadInt32();

            _reader.BaseStream.Position = _reader.BaseStream.Length - 4 - infoLen;
            byte[] bytes = _reader.ReadBytes(infoLen);
            var    ms    = new MemoryStream(bytes);

            _serializeInfo = (SerializerInfo)_formatter.Deserialize(ms);
            _serializeInfo.InitId2Object();
            _reader.BaseStream.Position = 0;

            return(ReadObject());
        }