ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Stream decorator that can cache previously read bytes from a sequentially read stream. More...
Public Member Functions | |
__construct (StreamInterface $stream, StreamInterface $target=null) | |
We will treat the buffer object as the body of the stream. More... | |
getSize () | |
Get the size of the stream if known. More... | |
rewind () | |
Seek to the beginning of the stream. More... | |
seek ($offset, $whence=SEEK_SET) | |
Seek to a position in the stream. More... | |
read ($length) | |
Read data from the stream. More... | |
write ($string) | |
Write data to the stream. More... | |
eof () | |
Returns true if the stream is at the end of the stream. More... | |
close () | |
Close both the remote stream and buffer 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... | |
detach () | |
Separates any underlying resources from the stream. More... | |
tell () | |
Returns the current position of the file read/write pointer. More... | |
isSeekable () | |
Returns whether or not the stream is seekable. More... | |
isWritable () | |
Returns whether or not the stream is writable. 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 Member Functions | |
cacheEntireStream () | |
Private Attributes | |
$remoteStream | |
$skipReadBytes = 0 | |
Stream decorator that can cache previously read bytes from a sequentially read stream.
Definition at line 10 of file CachingStream.php.
GuzzleHttp\Psr7\CachingStream::__construct | ( | StreamInterface | $stream, |
StreamInterface | $target = null |
||
) |
We will treat the buffer object as the body of the stream.
StreamInterface | $stream | Stream to cache |
StreamInterface | $target | Optionally specify where data is cached |
Definition at line 26 of file CachingStream.php.
References GuzzleHttp\Psr7\$stream, and $target.
|
private |
Definition at line 131 of file CachingStream.php.
References $target, GuzzleHttp\Psr7\copy_to_stream(), and Psr\Http\Message\StreamInterface\tell().
Referenced by GuzzleHttp\Psr7\CachingStream\seek().
GuzzleHttp\Psr7\CachingStream::close | ( | ) |
Close both the remote stream and buffer stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 126 of file CachingStream.php.
GuzzleHttp\Psr7\CachingStream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 118 of file CachingStream.php.
GuzzleHttp\Psr7\CachingStream::getSize | ( | ) |
Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 34 of file CachingStream.php.
GuzzleHttp\Psr7\CachingStream::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 75 of file CachingStream.php.
References $data, and $remaining.
Referenced by GuzzleHttp\Psr7\CachingStream\seek().
GuzzleHttp\Psr7\CachingStream::rewind | ( | ) |
Seek to the beginning of the stream.
If the stream is not seekable, this method will raise an exception; otherwise, it will perform a seek(0).
Implements Psr\Http\Message\StreamInterface.
Definition at line 39 of file CachingStream.php.
References GuzzleHttp\Psr7\CachingStream\seek().
GuzzleHttp\Psr7\CachingStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Seek to a position in the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 44 of file CachingStream.php.
References $size, GuzzleHttp\Psr7\CachingStream\cacheEntireStream(), GuzzleHttp\Psr7\CachingStream\read(), and Psr\Http\Message\StreamInterface\tell().
Referenced by GuzzleHttp\Psr7\CachingStream\rewind().
GuzzleHttp\Psr7\CachingStream::write | ( | $string | ) |
Write data to the stream.
string | $string | The string that is to be written. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 104 of file CachingStream.php.
References Psr\Http\Message\StreamInterface\tell().
|
private |
Definition at line 15 of file CachingStream.php.
|
private |
Definition at line 18 of file CachingStream.php.