DeserializeFromStream() static private method

static private DeserializeFromStream ( Stream stream, Type messageType ) : object
stream Stream
messageType System.Type
return object
        public void HandleMessage(string messageType, byte[] data)
        {
            object messageObject;
            Type   type;

            using (var ms = new MemoryStream(data))
            {
                lock (this.typeCache)
                {
                    if (!this.typeCache.TryGetValue(messageType, out type))
                    {
                        type = typeof(Animatroller.Framework.MonoExpanderMessages.Ping).Assembly.GetType(messageType, true);
                        this.typeCache.Add(messageType, type);
                    }
                }

                messageObject = Main.DeserializeFromStream(ms, type);
            }

            if (messageObject != null)
            {
                InternalInvokeMessage(type, messageObject);
            }
        }