示例#1
0
        internal static MalockNnsMessage Deserialize(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            BinaryReader br = new BinaryReader(stream);
            var          m  = new MalockNnsMessage();

            if (!MalockMessage.DeserializeTo(m, br))
            {
                return(null);
            }
            string s;

            if (!MalockMessage.TryFromStringInReadStream(br, out s))
            {
                return(null);
            }
            m.Key = s;
            if (!MalockMessage.TryFromStringInReadStream(br, out s))
            {
                return(null);
            }
            m.Identity = s;
            return(m);
        }
示例#2
0
 internal static bool TryDeserialize(Stream stream, out MalockNnsMessage message)
 {
     message = Deserialize(stream);
     return(message != null);
 }