ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Psr\Http\Message\StreamInterface Interface Reference

Describes a data stream. More...

+ Inheritance diagram for Psr\Http\Message\StreamInterface:
+ Collaboration diagram for Psr\Http\Message\StreamInterface:

Public Member Functions

 __toString ()
 Reads all data from the stream into a string, from the beginning to end. 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...
 
 tell ()
 Returns the current position of the file read/write pointer. More...
 
 eof ()
 Returns true if the stream is at the end of the stream. More...
 
 isSeekable ()
 Returns whether or not the stream is seekable. More...
 
 seek ($offset, $whence=SEEK_SET)
 Seek to a position in the stream. More...
 
 rewind ()
 Seek to the beginning of the stream. More...
 
 isWritable ()
 Returns whether or not the stream is writable. More...
 
 write ($string)
 Write data to the stream. More...
 
 isReadable ()
 Returns whether or not the stream is readable. More...
 
 read ($length)
 Read data from the stream. 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...
 

Detailed Description

Describes a data stream.

Typically, an instance will wrap a PHP stream; this interface provides a wrapper around the most common operations, including serialization of the entire stream to a string.

Definition at line 12 of file StreamInterface.php.

Member Function Documentation

◆ __toString()

Psr\Http\Message\StreamInterface::__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.

See also
http://php.net/manual/en/language.oop5.magic.php#object.tostring
Returns
string

Implemented in ILIAS\Filesystem\Stream\Stream, Slim\Http\Stream, GuzzleHttp\Psr7\Stream, GuzzleHttp\Psr7\FnStream, ZipStream\Stream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\AppendStream, and GuzzleHttp\Psr7\BufferStream.

◆ close()

◆ detach()

Psr\Http\Message\StreamInterface::detach ( )

◆ eof()

◆ getContents()

Psr\Http\Message\StreamInterface::getContents ( )

◆ getMetadata()

◆ getSize()

Psr\Http\Message\StreamInterface::getSize ( )

Get the size of the stream if known.

Returns
int|null Returns the size in bytes if known, or null if unknown.

Implemented in Slim\Http\Stream, ILIAS\Filesystem\Stream\Stream, GuzzleHttp\Psr7\Stream, ZipStream\Stream, GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\BufferStream, and GuzzleHttp\Psr7\CachingStream.

Referenced by GuzzleHttp\Psr7\MultipartStream\createElement().

+ Here is the caller graph for this function:

◆ isReadable()

Psr\Http\Message\StreamInterface::isReadable ( )

◆ isSeekable()

Psr\Http\Message\StreamInterface::isSeekable ( )

◆ isWritable()

Psr\Http\Message\StreamInterface::isWritable ( )

◆ read()

Psr\Http\Message\StreamInterface::read (   $length)

◆ rewind()

Psr\Http\Message\StreamInterface::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).

See also
seek() on failure.

Implemented in Slim\Http\Stream, ILIAS\Filesystem\Stream\Stream, GuzzleHttp\Psr7\Stream, ZipStream\Stream, GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, and ZipStream\DeflateStream.

Referenced by GuzzleHttp\Psr7\hash(), ILIAS\FileUpload\Processor\PreProcessorManagerImpl\process(), and ZipStream\File\processStreamWithComputedHeader().

+ Here is the caller graph for this function:

◆ seek()

◆ tell()

Psr\Http\Message\StreamInterface::tell ( )

◆ write()

Psr\Http\Message\StreamInterface::write (   $string)

Write data to the stream.

Parameters
string$stringThe string that is to be written.
Returns
int Returns the number of bytes written to the stream.
Exceptions

Implemented in Slim\Http\Stream, ILIAS\Filesystem\Stream\Stream, GuzzleHttp\Psr7\Stream, GuzzleHttp\Psr7\AppendStream, ZipStream\Stream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\CachingStream, and GuzzleHttp\Psr7\DroppingStream.

Referenced by GuzzleHttp\Psr7\copy_to_stream().

+ Here is the caller graph for this function:

The documentation for this interface was generated from the following file: