public function writeMethodCall($objectname, $methodname, PhpArgumentCollection $arguments = null, $static = false)
    {
        try {
            $this->writeVariable($objectname);

            if ($static === false) {
                $this->writeObjectOperator();
            } else {
                $this->writePaamayimNekudotayim();
            }

            $this->getStream()->write($methodname);
            $this->writeOpeningParenthesis();

            if (is_null($arguments) === false) {
                $this->writeArguments($arguments);
            }

            $this->writeClosingParenthesis();
        } catch (Exception $e) {
            $msg = "An error occured while writing a method call.";
            throw new StreamAccessException($msg, $this, 0, $e);
        }
    }