ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Provides a buffer stream that can be written to to fill a buffer, and read from to remove bytes from the buffer. More...
Public Member Functions | |
__construct ($hwm=16384) | |
__toString () | |
Reads all data from the stream into a string, from the beginning to end. More... | |
getContents () | |
Returns the remaining contents in a string. More... | |
close () | |
Closes the stream and any underlying resources. More... | |
detach () | |
Separates any underlying resources from the stream. More... | |
getSize () | |
Get the size of the stream if known. More... | |
isReadable () | |
Returns whether or not the stream is readable. More... | |
isWritable () | |
Returns whether or not the stream is writable. More... | |
isSeekable () | |
Returns whether or not the stream is seekable. More... | |
rewind () | |
Seek to the beginning of the stream. More... | |
seek ($offset, $whence=SEEK_SET) | |
Seek to a position in the stream. More... | |
eof () | |
Returns true if the stream is at the end of the stream. More... | |
tell () | |
Returns the current position of the file read/write pointer. More... | |
read ($length) | |
Reads data from the buffer. More... | |
write ($string) | |
Writes data to the buffer. More... | |
getMetadata ($key=null) | |
Get stream metadata as an associative array or retrieve a specific key. More... | |
Private Attributes | |
$hwm | |
$buffer = '' | |
Provides a buffer stream that can be written to to fill a buffer, and read from to remove bytes from the buffer.
This stream returns a "hwm" metadata value that tells upstream consumers what the configured high water mark of the stream is, or the maximum preferred size of the buffer.
Definition at line 14 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::__construct | ( | $hwm = 16384 | ) |
int | $hwm | High water mark, representing the preferred maximum buffer size. If the size of the buffer exceeds the high water mark, then calls to write will continue to succeed but will return false to inform writers to slow down until the buffer has been drained by reading from it. |
Definition at line 26 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\$hwm.
GuzzleHttp\Psr7\BufferStream::__toString | ( | ) |
Reads all data from the stream into a string, from the beginning to end.
This method MUST attempt to seek to the beginning of the stream before reading data and read the stream until the end is reached.
Warning: This could attempt to load a large amount of data into memory.
This method MUST NOT raise an exception in order to conform with PHP's string casting operations.
Implements Psr\Http\Message\StreamInterface.
Definition at line 31 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\getContents().
GuzzleHttp\Psr7\BufferStream::close | ( | ) |
Closes the stream and any underlying resources.
Implements Psr\Http\Message\StreamInterface.
Definition at line 44 of file BufferStream.php.
Referenced by GuzzleHttp\Psr7\BufferStream\detach().
GuzzleHttp\Psr7\BufferStream::detach | ( | ) |
Separates any underlying resources from the stream.
After the stream has been detached, the stream is in an unusable state.
Implements Psr\Http\Message\StreamInterface.
Definition at line 49 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\close().
GuzzleHttp\Psr7\BufferStream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 84 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::getContents | ( | ) |
Returns the remaining contents in a string.
Implements Psr\Http\Message\StreamInterface.
Definition at line 36 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\$buffer.
Referenced by GuzzleHttp\Psr7\BufferStream\__toString().
GuzzleHttp\Psr7\BufferStream::getMetadata | ( | $key = null | ) |
Get stream metadata as an associative array or retrieve a specific key.
The keys returned are identical to the keys returned from PHP's stream_get_meta_data() function.
Implements Psr\Http\Message\StreamInterface.
Definition at line 129 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\$hwm, and $key.
GuzzleHttp\Psr7\BufferStream::getSize | ( | ) |
Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 54 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::isReadable | ( | ) |
Returns whether or not the stream is readable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 59 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::isSeekable | ( | ) |
Returns whether or not the stream is seekable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 69 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::isWritable | ( | ) |
Returns whether or not the stream is writable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 64 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::read | ( | $length | ) |
Reads data from the buffer.
Implements Psr\Http\Message\StreamInterface.
Definition at line 97 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\$buffer, and $result.
GuzzleHttp\Psr7\BufferStream::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 74 of file BufferStream.php.
References GuzzleHttp\Psr7\BufferStream\seek().
GuzzleHttp\Psr7\BufferStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Seek to a position in the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 79 of file BufferStream.php.
Referenced by GuzzleHttp\Psr7\BufferStream\rewind().
GuzzleHttp\Psr7\BufferStream::tell | ( | ) |
Returns the current position of the file read/write pointer.
Implements Psr\Http\Message\StreamInterface.
Definition at line 89 of file BufferStream.php.
GuzzleHttp\Psr7\BufferStream::write | ( | $string | ) |
Writes data to the buffer.
Implements Psr\Http\Message\StreamInterface.
Definition at line 117 of file BufferStream.php.
|
private |
Definition at line 17 of file BufferStream.php.
Referenced by GuzzleHttp\Psr7\BufferStream\getContents(), and GuzzleHttp\Psr7\BufferStream\read().
|
private |
Definition at line 16 of file BufferStream.php.
Referenced by GuzzleHttp\Psr7\BufferStream\__construct(), and GuzzleHttp\Psr7\BufferStream\getMetadata().