public function reset($pos = 0, $length = 200)
    {
        if ($pos === null) {
            $pos = $this->position + $this->offset;
        } elseif ($pos < 0) {
            $pos = \max(0, $this->getTotalLength() + $pos);
        }

        \fseek($this->stream, $pos);

        $this->position = $pos;
        $this->buffer = $length > 0 ? \fread($this->stream, $length) : '';
        $this->bufferLength = \strlen($this->buffer);
        $this->offset = 0;

        // If a stream wrapper is in use it is possible that
        // length values > 8096 will be ignored, so use the
        // increaseLength()-method to correct that behavior
        if ($this->bufferLength < $length && $this->increaseLength($length - $this->bufferLength)) {
            // increaseLength parameter is $minLength, so cut to have only the required bytes in the buffer
            $this->buffer = \substr($this->buffer, 0, $length);
            $this->bufferLength = \strlen($this->buffer);
        }
    }
public function reset($pos = 0, $length = 200)
    {
        if ($pos === null) {
            $pos = $this->position + $this->offset;
        } elseif ($pos < 0) {
            $pos = \max(0, $this->getTotalLength() + $pos);
        }

        \fseek($this->stream, $pos);

        $this->position = $pos;
        $this->buffer = $length > 0 ? \fread($this->stream, $length) : '';
        $this->bufferLength = \strlen($this->buffer);
        $this->offset = 0;

        // If a stream wrapper is in use it is possible that
        // length values > 8096 will be ignored, so use the
        // increaseLength()-method to correct that behavior
        if ($this->bufferLength < $length && $this->increaseLength($length - $this->bufferLength)) {
            // increaseLength parameter is $minLength, so cut to have only the required bytes in the buffer
            $this->buffer = \substr($this->buffer, 0, $length);
            $this->bufferLength = \strlen($this->buffer);
        }
    }
public function reset ( $ pos = 0 , $ length = 200 ) { if ( $ pos === null ) { $ pos = $ this -> position + $ this -> offset ; } elseif ( $ pos < 0 ) { $ pos = \ max ( 0 , $ this -> getTotalLength ( ) + $ pos ) ; } \ fseek ( $ this -> stream , $ pos ) ; $ this -> position = $ pos ; $ this -> buffer = $ length > 0 ? \ fread ( $ this -> stream , $ length ) : '' ; $ this -> bufferLength = \ strlen ( $ this -> buffer ) ; $ this -> offset = 0 ; // If a stream wrapper is in use it is possible that // length values > 8096 will be ignored, so use the // increaseLength()-method to correct that behavior if ( $ this -> bufferLength < $ length && $ this -> increaseLength ( $ length - $ this -> bufferLength ) ) { // increaseLength parameter is $minLength, so cut to have only the required bytes in the buffer $ this -> buffer = \ substr ( $ this -> buffer , 0 , $ length ) ; $ this -> bufferLength = \ strlen ( $ this -> buffer ) ; } }
Resets the buffer to a position and re-read the buffer with the given length.

If the $pos parameter is negative the start buffer position will be the $pos'th position from
the end of the file.

If the $pos parameter is negative and the absolute value is bigger then the totalLength of
the file $pos will set to zero.

@param int|null $pos Start position of the new buffer
@param int $length Length of the new buffer. Mustn't be negative
Resets the buffer to a position and re - read the buffer with the given length .