public function getStreamContext()
    {
        if ($this->_options['streamContext'] !== null) {
            if (is_resource($this->_options['streamContext'])) {
                return $this->_options['streamContext'];
            }
            if (is_array($this->_options['streamContext'])) {
                return stream_context_create($this->_options['streamContext']);
            }
        }
        return null;
    }