Open Journal Systems  3.3.0
Psr\Http\Message\StreamInterface Interface Reference
Inheritance diagram for Psr\Http\Message\StreamInterface:
GuzzleHttp\Psr7\AppendStream GuzzleHttp\Psr7\BufferStream GuzzleHttp\Psr7\CachingStream GuzzleHttp\Psr7\DroppingStream GuzzleHttp\Psr7\FnStream GuzzleHttp\Psr7\InflateStream GuzzleHttp\Psr7\LazyOpenStream GuzzleHttp\Psr7\LimitStream GuzzleHttp\Psr7\MultipartStream GuzzleHttp\Psr7\NoSeekStream GuzzleHttp\Psr7\PumpStream GuzzleHttp\Psr7\Stream Http\Message\Encoding\FilteredStream Http\Message\Stream\BufferedStream

Public Member Functions

 __toString ()
 
 close ()
 
 detach ()
 
 eof ()
 
 getContents ()
 
 getMetadata ($key=null)
 
 getSize ()
 
 isReadable ()
 
 isSeekable ()
 
 isWritable ()
 
 read ($length)
 
 rewind ()
 
 seek ($offset, $whence=SEEK_SET)
 
 tell ()
 
 write ($string)
 

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 vendor/psr/http-message/src/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 Http\Message\Encoding\FilteredStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\Stream, Http\Message\Stream\BufferedStream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\AppendStream, and GuzzleHttp\Psr7\BufferStream.

◆ close()

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

◆ detach()

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

Separates any underlying resources from the stream.

After the stream has been detached, the stream is in an unusable state.

Returns
resource|null Underlying PHP stream, if any

Implemented in GuzzleHttp\Psr7\Stream, GuzzleHttp\Psr7\FnStream, Http\Message\Stream\BufferedStream, GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\PumpStream, and GuzzleHttp\Psr7\BufferStream.

◆ eof()

◆ getContents()

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

◆ getMetadata()

Psr\Http\Message\StreamInterface::getMetadata (   $key = null)

◆ getSize()

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

◆ isReadable()

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

◆ isSeekable()

◆ isWritable()

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

◆ read()

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

Read data from the stream.

Parameters
int$lengthRead 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
string Returns the data read from the stream, or an empty string if no bytes are available.
Exceptions

Implemented in Http\Message\Stream\BufferedStream, GuzzleHttp\Psr7\Stream, GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\LimitStream, GuzzleHttp\Psr7\PumpStream, Http\Message\Encoding\FilteredStream, GuzzleHttp\Psr7\BufferStream, and GuzzleHttp\Psr7\CachingStream.

◆ 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 Http\Message\Encoding\FilteredStream, GuzzleHttp\Psr7\Stream, Http\Message\Stream\BufferedStream, GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\BufferStream, and GuzzleHttp\Psr7\CachingStream.

◆ 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 GuzzleHttp\Psr7\AppendStream, GuzzleHttp\Psr7\Stream, Http\Message\Stream\BufferedStream, GuzzleHttp\Psr7\FnStream, GuzzleHttp\Psr7\PumpStream, GuzzleHttp\Psr7\BufferStream, GuzzleHttp\Psr7\CachingStream, and GuzzleHttp\Psr7\DroppingStream.

Referenced by GuzzleHttp\Psr7\copy_to_stream().


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