public function readTypedObject()
    {
         require_once 'Zend/Amf/Parse/TypeLoader.php';
        // get the remote class name
        $className = $this->_stream->readUTF();
        $loader = Zend_Amf_Parse_TypeLoader::loadType($className);
        $returnObject = new $loader();
        $properties = get_object_vars($this->readObject());
        foreach($properties as $key=>$value) {
            if($key) {
                $returnObject->$key = $value;
            }
        }
        if($returnObject instanceof Zend_Amf_Value_Messaging_ArrayCollection) {
            $returnObject = get_object_vars($returnObject);
        }
        return $returnObject;
    }