You are here

public function CachingStream::__construct in Lockr 7.3

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+'));
}