Actions

API16

JBuffer/stream seek

From Joomla! Documentation

< API16:JBuffer
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Contents

Syntax

stream_seek($offset, $whence)
Parameter Name Default Value Description
$offset
$whence

Defined in

libraries/joomla/utilities/buffer.php

Importing

jimport( 'joomla.utilities.buffer' );

Source Body

function stream_seek($offset, $whence)
{
        switch ($whence)
        {
                case SEEK_SET :
                        if ($offset < strlen($this->_buffers[$this->name]) && $offset >= 0) {
                                $this->position = $offset;
                                return true;
                        } else {
                                return false;
                        }
                        break;
 
                case SEEK_CUR :
                        if ($offset >= 0) {
                                $this->position += $offset;
                                return true;
                        } else {
                                return false;
                        }
                        break;
 
                case SEEK_END :
                        if (strlen($this->_buffers[$this->name]) + $offset >= 0) {
                                $this->position = strlen($this->_buffers[$this->name]) + $offset;
                                return true;
                        } else {
                                return false;
                        }
                        break;
 
                default :
                        return false;
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />