API16

JBuffer/stream seek

< API16:JBuffer

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

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

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 transcluded page call, red link never existed >

Examples

Code Examples


Advertisement