|
| __construct (StreamInterface $stream, StreamInterface $target=null) |
| We will treat the buffer object as the body of the stream.
|
|
| __toString () |
| Reads all data from the stream into a string, from the beginning to end.
|
|
| close () |
| Close both the remote stream and buffer stream.
|
|
| 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 () |
| Get the size of the stream if known.
|
|
| 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) |
| Seek to a position in the stream.
|
|
| tell () |
| Returns the current position of the file read/write pointer.
|
|
| write ($string) |
| Write data to the stream.
|
|
◆ __construct()
We will treat the buffer object as the body of the stream.
- Parameters
-
StreamInterface | $stream | Stream to cache. The cursor is assumed to be at the beginning of the stream. |
StreamInterface | $target | Optionally specify where data is cached |
◆ __toString()
Psr\Http\Message\StreamInterface::__toString |
( |
| ) |
|
|
inherited |
◆ close()
GuzzleHttp\Psr7\CachingStream::close |
( |
| ) |
|
◆ detach()
Psr\Http\Message\StreamInterface::detach |
( |
| ) |
|
|
inherited |
◆ eof()
GuzzleHttp\Psr7\CachingStream::eof |
( |
| ) |
|
◆ getContents()
Psr\Http\Message\StreamInterface::getContents |
( |
| ) |
|
|
inherited |
◆ getMetadata()
Psr\Http\Message\StreamInterface::getMetadata |
( |
| $key = null | ) |
|
|
inherited |
◆ getSize()
GuzzleHttp\Psr7\CachingStream::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\CachingStream::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()
GuzzleHttp\Psr7\CachingStream::rewind |
( |
| ) |
|
◆ seek()
GuzzleHttp\Psr7\CachingStream::seek |
( |
| $offset, |
|
|
| $whence = SEEK_SET ) |
Seek to a position in the stream.
@externalurl http://www.php.net/manual/en/function.fseek.php
- Parameters
-
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. |
- Exceptions
-
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
◆ tell()
Psr\Http\Message\StreamInterface::tell |
( |
| ) |
|
|
inherited |
◆ write()
GuzzleHttp\Psr7\CachingStream::write |
( |
| $string | ) |
|
Write data to the stream.
- Parameters
-
string | $string | The string that is to be written. |
- Return values
-
int | Returns the number of bytes written to the stream. |
- Exceptions
-
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
The documentation for this class was generated from the following file:
- lib/guzzlehttp/psr7/src/CachingStream.php