Back to StreamString class

Method stream_read

public string
stream_read
(mixed $count)
Method to read a given number of bytes starting at the current position and moving to the end of the string defined by the current position plus the given number.
Parameters
  • int $count Bytes of data from the current position should be returned.
Returns
  • string
Since
  • 1.7.0
-
  • https://www.php.net/manual/en/streamwrapper.stream-read.php
Class: StreamString
Project: Joomla

Method stream_read - Source code

/**
 * Method to read a given number of bytes starting at the current position
 * and moving to the end of the string defined by the current position plus the
 * given number.
 *
 * @param   integer  $count  Bytes of data from the current position should be returned.
 *
 * @return  string
 *
 * @since   1.7.0
 *
 * @link    https://www.php.net/manual/en/streamwrapper.stream-read.php
 */
public function stream_read($count)
{
    $result = substr($this->currentString, $this->pos, $count);
    $this->pos += $count;
    return $result;
}