Back to BufferStreamHandler class

Method stream_seek

public bool
stream_seek
(mixed $offset, mixed $whence)
The read write position updates in response to $offset and $whence
Parameters
  • int $offset The offset in bytes
  • int $whence Position the offset is added to Options are SEEK_SET, SEEK_CUR, and SEEK_END
Returns
  • bool True if updated
Since
  • 1.7.0
-
  • \Joomla\CMS\Utility\streamWrapper::stream_seek

Method stream_seek - Source code

/**
 * The read write position updates in response to $offset and $whence
 *
 * @param   integer  $offset  The offset in bytes
 * @param   integer  $whence  Position the offset is added to
 *                            Options are SEEK_SET, SEEK_CUR, and SEEK_END
 *
 * @return  boolean  True if updated
 *
 * @see     streamWrapper::stream_seek
 * @since   1.7.0
 */
public function stream_seek($offset, $whence)
{
    switch ($whence) {
        case SEEK_SET:
            return $this->seek_set($offset);
        case SEEK_CUR:
            return $this->seek_cur($offset);
        case SEEK_END:
            return $this->seek_end($offset);
    }
    return false;
}