public function ReadLimitEntityBody::__construct

Parameters

EntityBodyInterface $body Body to wrap:

int $limit Total number of bytes to allow to be read from the stream:

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

Overrides AbstractEntityBodyDecorator::__construct

File

drupal/core/vendor/guzzle/http/Guzzle/Http/ReadLimitEntityBody.php, line 25

Class

ReadLimitEntityBody
EntityBody decorator used to return only a subset of an entity body

Namespace

Guzzle\Http

Code

public function __construct(EntityBodyInterface $body, $limit, $offset = 0) {
  parent::__construct($body);
  $this
    ->setLimit($limit)
    ->setOffset($offset);
  $this->body
    ->seek($offset);
}