$remoteStream
$remoteStream : \Psr\Http\Message\StreamInterface
Stream decorator that can cache previously read bytes from a sequentially read stream.
$remoteStream : \Psr\Http\Message\StreamInterface
__construct(\Psr\Http\Message\StreamInterface $stream, \Psr\Http\Message\StreamInterface $target = null)
We will treat the buffer object as the body of the stream
\Psr\Http\Message\StreamInterface | $stream | Stream to cache |
\Psr\Http\Message\StreamInterface | $target | Optionally specify where data is cached |
__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(integer $offset, integer $whence = SEEK_SET)
Seek to a position in the stream.
integer | $offset | Stream offset |
integer | $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(integer $length) : string
Read data from the stream.
integer | $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.
createStream() : \Psr\Http\Message\StreamInterface
Implement in subclasses to dynamically create streams when requested.