Kraken\Util\Buffer\BufferIterator::seek PHP Метод

seek() публичный Метод

Move to the given position in the buffer.
public seek ( integer $position )
$position integer
    public function seek($position)
    {
        $position = (int) $position;
        if (0 > $position) {
            $position = 0;
        }
        $this->current = $position;
    }

Usage Example

Пример #1
0
 public function testApiSeek_WhenInvalidPositionIsPassed()
 {
     $this->iterator->seek(-1);
     $this->assertSame(0, $this->iterator->key());
 }