|
| __construct (StreamInterface $stream, int $limit=-1, int $offset=0) |
|
| __toString () |
| Reads all data from the stream into a string, from the beginning to end.
|
|
| close () |
| Closes the stream and any underlying resources.
|
|
| detach () |
| Separates any underlying resources from the stream.
|
|
| eof () |
| Returns true if the stream is at the end of the stream.
|
|
| getContents () |
| Returns the remaining contents in a string.
|
|
| getMetadata ($key=null) |
| Get stream metadata as an associative array or retrieve a specific key.
|
|
| getSize () |
| Returns the size of the limited subset of data.
|
|
| isReadable () |
| Returns whether or not the stream is readable.
|
|
| isSeekable () |
| Returns whether or not the stream is seekable.
|
|
| isWritable () |
| Returns whether or not the stream is writable.
|
|
| read ($length) |
| Read data from the stream.
|
|
| rewind () |
| Seek to the beginning of the stream.
|
|
| seek ($offset, $whence=SEEK_SET) |
| Allow for a bounded seek on the read limited stream.
|
|
| setLimit (int $limit) |
| Set the limit of bytes that the decorator allows to be read from the stream.
|
|
| setOffset (int $offset) |
| Set the offset to start limiting from.
|
|
| tell () |
| Give a relative tell()
|
|
| write ($string) |
| Write data to the stream.
|
|
◆ __construct()
GuzzleHttp\Psr7\LimitStream::__construct |
( |
StreamInterface | $stream, |
|
|
int | $limit = -1, |
|
|
int | $offset = 0 ) |
- 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 | $offset | Position to seek to before reading (only works on seekable streams). |
◆ __toString()
Psr\Http\Message\StreamInterface::__toString |
( |
| ) |
|
|
inherited |
◆ close()
Psr\Http\Message\StreamInterface::close |
( |
| ) |
|
|
inherited |
◆ detach()
Psr\Http\Message\StreamInterface::detach |
( |
| ) |
|
|
inherited |
◆ eof()
GuzzleHttp\Psr7\LimitStream::eof |
( |
| ) |
|
◆ getContents()
Psr\Http\Message\StreamInterface::getContents |
( |
| ) |
|
|
inherited |
◆ getMetadata()
Psr\Http\Message\StreamInterface::getMetadata |
( |
| $key = null | ) |
|
|
inherited |
◆ getSize()
GuzzleHttp\Psr7\LimitStream::getSize |
( |
| ) |
|
◆ isReadable()
Psr\Http\Message\StreamInterface::isReadable |
( |
| ) |
|
|
inherited |
◆ isSeekable()
Psr\Http\Message\StreamInterface::isSeekable |
( |
| ) |
|
|
inherited |
◆ isWritable()
Psr\Http\Message\StreamInterface::isWritable |
( |
| ) |
|
|
inherited |
◆ read()
GuzzleHttp\Psr7\LimitStream::read |
( |
| $length | ) |
|
Read data from the stream.
- Parameters
-
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. |
- Return values
-
string | Returns the data read from the stream, or an empty string if no bytes are available. |
- Exceptions
-
RuntimeException | if an error occurs. |
Implements Psr\Http\Message\StreamInterface.
◆ rewind()
Psr\Http\Message\StreamInterface::rewind |
( |
| ) |
|
|
inherited |
◆ seek()
GuzzleHttp\Psr7\LimitStream::seek |
( |
| $offset, |
|
|
| $whence = SEEK_SET ) |
◆ setLimit()
GuzzleHttp\Psr7\LimitStream::setLimit |
( |
int | $limit | ) |
|
Set the limit of bytes that the decorator allows to be read from the stream.
- Parameters
-
int | $limit | Number of bytes to allow to be read from the stream. Use -1 for no limit. |
◆ setOffset()
GuzzleHttp\Psr7\LimitStream::setOffset |
( |
int | $offset | ) |
|
Set the offset to start limiting from.
- Parameters
-
int | $offset | Offset to seek to and begin byte limiting from |
- Exceptions
-
RuntimeException | if the stream cannot be seeked. |
◆ tell()
GuzzleHttp\Psr7\LimitStream::tell |
( |
| ) |
|
◆ write()
Psr\Http\Message\StreamInterface::write |
( |
| $string | ) |
|
|
inherited |
The documentation for this class was generated from the following file:
- lib/guzzlehttp/psr7/src/LimitStream.php