Set the stream that is wrapped by the object
resource $stream Stream resource to wrap:
int $size Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.:
self
Overrides StreamInterface::setStream
public function setStream($stream, $size = null) {
if (!is_resource($stream)) {
throw new InvalidArgumentException('Stream must be a resource');
}
$this->size = $size;
$this->stream = $stream;
$this
->rebuildCache();
return $this;
}