You are here

public function LimitStream::__construct in Zircon Profile 8

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

Parameters

StreamInterface $stream Stream to wrap:

int $limit Total number of bytes to allow to be read: from the stream. Pass -1 for no limit.

int|null $offset Position to seek to before reading (only: works on seekable streams).

Overrides StreamDecoratorTrait::__construct

File

vendor/guzzlehttp/psr7/src/LimitStream.php, line 27

Class

LimitStream
Decorator used to return only a subset of a stream

Namespace

GuzzleHttp\Psr7

Code

public function __construct(StreamInterface $stream, $limit = -1, $offset = 0) {
  $this->stream = $stream;
  $this
    ->setLimit($limit);
  $this
    ->setOffset($offset);
}