public function Stream::setStream

Set the stream that is wrapped by the object

Parameters

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.:

Return value

self

Overrides StreamInterface::setStream

1 call to Stream::setStream()
Stream::__construct in drupal/core/vendor/guzzle/stream/Guzzle/Stream/Stream.php
Construct a new Stream

File

drupal/core/vendor/guzzle/stream/Guzzle/Stream/Stream.php, line 137

Class

Stream
PHP stream implementation

Namespace

Guzzle\Stream

Code

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;
}