/** * @return \Riak\Client\Core\Transport\Proto\ProtoStream */ public function getStream() { if ($this->stream != null && $this->stream->isResource()) { return $this->stream; } return $this->stream = $this->createStream(); }