public object Deserialize(Stream dataStream, Stream infoStream) { _reader = new BinaryReader(dataStream); _serializeInfo = (SerializerInfo)_formatter.Deserialize(infoStream); _serializeInfo.InitId2Object(); return(ReadObject()); }
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()); }