$offset
$offset : int
Decorator used to return only a subset of a stream.
$offset : int
$limit : int
__construct(\Psr\Http\Message\StreamInterface $stream, int $limit = -1, int $offset) : mixed
\Psr\Http\Message\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 | $offset | Position to seek to before reading (only works on seekable streams). |
__get(string $name) : \Psr\Http\Message\StreamInterface
Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).
string | $name | Name of the property (allows "stream" only). |
seek(mixed $offset, mixed $whence = SEEK_SET) : mixed
Allow for a bounded seek on the read limited stream {@inheritdoc}
mixed | $offset | Stream offset |
mixed | $whence | Specifies how the cursor position will be calculated
based on the seek offset. Valid values are identical to the built-in
PHP $whence values for |
read(mixed $length) : string
Read data from the stream.
mixed | $length | Read up to $length bytes from the object and return them. Fewer than $length bytes may be returned if underlying stream call returns fewer bytes. |
Returns the data read from the stream, or an empty string if no bytes are available.