Back to BufferStreamHandler class

Method seek_set

protected bool
seek_set
(mixed $offset)
Set the position to the offset
Parameters
  • int $offset The offset in bytes
Returns
  • bool

Method seek_set - Source code

/**
 * Set the position to the offset
 *
 * @param   integer  $offset  The offset in bytes
 *
 * @return  boolean
 */
protected function seek_set($offset)
{
    if ($offset < 0 || $offset > \strlen($this->buffers[$this->name])) {
        return false;
    }
    $this->position = $offset;
    return true;
}