public function ensure($pos, $length)
    {
        if ($pos >= $this->position
            && $pos < ($this->position + $this->bufferLength)
            && ($this->position + $this->bufferLength) >= ($pos + $length)
        ) {
            $this->offset = $pos - $this->position;
        } else {
            $this->reset($pos, $length);
        }
    }
public function ensure($pos, $length)
    {
        if ($pos >= $this->position
            && $pos < ($this->position + $this->bufferLength)
            && ($this->position + $this->bufferLength) >= ($pos + $length)
        ) {
            $this->offset = $pos - $this->position;
        } else {
            $this->reset($pos, $length);
        }
    }
public function ensure ( $ pos , $ length ) { if ( $ pos >= $ this -> position && $ pos < ( $ this -> position + $ this -> bufferLength ) && ( $ this -> position + $ this -> bufferLength ) >= ( $ pos + $ length ) ) { $ this -> offset = $ pos - $ this -> position ; } else { $ this -> reset ( $ pos , $ length ) ; } }
Ensures bytes in the buffer with a specific length and location in the file.

@param int $pos
@param int $length
@see reset()
Ensures bytes in the buffer with a specific length and location in the file .