You are here

public function CachingStream::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/src/CachingStream.php \GuzzleHttp\Psr7\CachingStream::__construct()

We will treat the buffer object as the body of the stream

Parameters

StreamInterface $stream Stream to cache:

StreamInterface $target Optionally specify where data is cached:

Overrides StreamDecoratorTrait::__construct

File

vendor/guzzlehttp/psr7/src/CachingStream.php, line 26

Class

CachingStream
Stream decorator that can cache previously read bytes from a sequentially read stream.

Namespace

GuzzleHttp\Psr7

Code

public function __construct(StreamInterface $stream, StreamInterface $target = null) {
  $this->remoteStream = $stream;
  $this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
}