Back to BufferStreamHandler class

Method stream_read

public mixed
stream_read
(mixed $count)
Read stream
Parameters
  • int $count How many bytes of data from the current position should be returned.
Returns
  • mixed The data from the stream up to the specified number of bytes (all data if the total number of bytes in the stream is less than $count. Null if the stream is empty.
Since
  • 1.7.0
-
  • \Joomla\CMS\Utility\streamWrapper::stream_read

Method stream_read - Source code

/**
 * Read stream
 *
 * @param   integer  $count  How many bytes of data from the current position should be returned.
 *
 * @return  mixed    The data from the stream up to the specified number of bytes (all data if
 *                   the total number of bytes in the stream is less than $count. Null if
 *                   the stream is empty.
 *
 * @see     streamWrapper::stream_read
 * @since   1.7.0
 */
public function stream_read($count)
{
    $ret = substr($this->buffers[$this->name], $this->position, $count);
    $this->position += \strlen($ret);
    return $ret;
}