PHP Class GuzzleHttp\Psr7\LimitStream

Inheritance: implements Psr\Http\Message\StreamInterface, use trait GuzzleHttp\Psr7\StreamDecoratorTrait
Show file Open project: nystudio107/instantanalytics Class Usage Examples

Public Methods

Method Description
__construct ( Psr\Http\Message\StreamInterface $stream, integer $limit, integer $offset )
eof ( )
getSize ( ) Returns the size of the limited subset of data {@inheritdoc}
read ( $length )
seek ( $offset, $whence = SEEK_SET ) Allow for a bounded seek on the read limited stream {@inheritdoc}
setLimit ( integer $limit ) Set the limit of bytes that the decorator allows to be read from the stream.
setOffset ( integer $offset ) Set the offset to start limiting from
tell ( ) Give a relative tell() {@inheritdoc}

Method Details

__construct() public method

public __construct ( Psr\Http\Message\StreamInterface $stream, integer $limit, integer $offset )
$stream Psr\Http\Message\StreamInterface Stream to wrap
$limit integer Total number of bytes to allow to be read from the stream. Pass -1 for no limit.
$offset integer Position to seek to before reading (only works on seekable streams).

eof() public method

public eof ( )

getSize() public method

Returns the size of the limited subset of data {@inheritdoc}
public getSize ( )

read() public method

public read ( $length )

seek() public method

Allow for a bounded seek on the read limited stream {@inheritdoc}
public seek ( $offset, $whence = SEEK_SET )

setLimit() public method

Set the limit of bytes that the decorator allows to be read from the stream.
public setLimit ( integer $limit )
$limit integer Number of bytes to allow to be read from the stream. Use -1 for no limit.

setOffset() public method

Set the offset to start limiting from
public setOffset ( integer $offset )
$offset integer Offset to seek to and begin byte limiting from

tell() public method

Give a relative tell() {@inheritdoc}
public tell ( )