ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Decorator used to return only a subset of a stream. More...
Public Member Functions | |||
__construct (StreamInterface $stream, $limit=-1, $offset=0) | |||
eof () | |||
Returns true if the stream is at the end of the stream. More... | |||
getSize () | |||
Returns the size of the limited subset of data {Get the size of the stream if known.
| |||
seek ($offset, $whence=SEEK_SET) | |||
Allow for a bounded seek on the read limited stream {Seek to a position in the stream.int $offset Stream offset int $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 fseek() . SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset. on failure.}. More... | |||
tell () | |||
Give a relative tell() {Returns the current position of the file read/write pointer.
| |||
setOffset ($offset) | |||
Set the offset to start limiting from. More... | |||
setLimit ($limit) | |||
Set the limit of bytes that the decorator allows to be read from the stream. More... | |||
read ($length) | |||
Read data from the stream. More... | |||
Public Member Functions inherited from Psr\Http\Message\StreamInterface | |||
__toString () | |||
Reads all data from the stream into a string, from the beginning to end. More... | |||
close () | |||
Closes the stream and any underlying resources. More... | |||
detach () | |||
Separates any underlying resources from the stream. More... | |||
isSeekable () | |||
Returns whether or not the stream is seekable. More... | |||
rewind () | |||
Seek to the beginning of the stream. More... | |||
isWritable () | |||
Returns whether or not the stream is writable. More... | |||
write ($string) | |||
Write data to the stream. More... | |||
isReadable () | |||
Returns whether or not the stream is readable. More... | |||
getContents () | |||
Returns the remaining contents in a string. More... | |||
getMetadata ($key=null) | |||
Get stream metadata as an associative array or retrieve a specific key. More... | |||
Private Attributes | |
$offset | |
$limit | |
Decorator used to return only a subset of a stream.
Definition at line 10 of file LimitStream.php.
GuzzleHttp\Psr7\LimitStream::__construct | ( | StreamInterface | $stream, |
$limit = -1 , |
|||
$offset = 0 |
|||
) |
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). |
Definition at line 27 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$limit, GuzzleHttp\Psr7\LimitStream\$offset, GuzzleHttp\Psr7\$stream, GuzzleHttp\Psr7\LimitStream\setLimit(), and GuzzleHttp\Psr7\LimitStream\setOffset().
GuzzleHttp\Psr7\LimitStream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 37 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$limit.
GuzzleHttp\Psr7\LimitStream::getSize | ( | ) |
Returns the size of the limited subset of data {Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 56 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$offset.
GuzzleHttp\Psr7\LimitStream::read | ( | $length | ) |
Read data from the stream.
int | $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. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 138 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$limit, and $remaining.
GuzzleHttp\Psr7\LimitStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Allow for a bounded seek on the read limited stream {Seek to a position in the stream.int $offset Stream offset int $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 fseek()
. SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset. on failure.}.
Implements Psr\Http\Message\StreamInterface.
Definition at line 71 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$limit, and GuzzleHttp\Psr7\LimitStream\$offset.
GuzzleHttp\Psr7\LimitStream::setLimit | ( | $limit | ) |
Set the limit of bytes that the decorator allows to be read from the stream.
int | $limit | Number of bytes to allow to be read from the stream. Use -1 for no limit. |
Definition at line 133 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$limit.
Referenced by GuzzleHttp\Psr7\LimitStream\__construct().
GuzzleHttp\Psr7\LimitStream::setOffset | ( | $offset | ) |
Set the offset to start limiting from.
int | $offset | Offset to seek to and begin byte limiting from |
Definition at line 108 of file LimitStream.php.
References $current, and GuzzleHttp\Psr7\LimitStream\$offset.
Referenced by GuzzleHttp\Psr7\LimitStream\__construct().
GuzzleHttp\Psr7\LimitStream::tell | ( | ) |
Give a relative tell() {Returns the current position of the file read/write pointer.
Implements Psr\Http\Message\StreamInterface.
Definition at line 96 of file LimitStream.php.
References GuzzleHttp\Psr7\LimitStream\$offset.
|
private |
Definition at line 18 of file LimitStream.php.
Referenced by GuzzleHttp\Psr7\LimitStream\__construct(), GuzzleHttp\Psr7\LimitStream\eof(), GuzzleHttp\Psr7\LimitStream\read(), GuzzleHttp\Psr7\LimitStream\seek(), and GuzzleHttp\Psr7\LimitStream\setLimit().
|
private |
Definition at line 15 of file LimitStream.php.
Referenced by GuzzleHttp\Psr7\LimitStream\__construct(), GuzzleHttp\Psr7\LimitStream\getSize(), GuzzleHttp\Psr7\LimitStream\seek(), GuzzleHttp\Psr7\LimitStream\setOffset(), and GuzzleHttp\Psr7\LimitStream\tell().