You are here

public function SeekableFileContent::seek in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php \org\bovigo\vfs\content\SeekableFileContent::seek()

seeks to the given offset

Parameters

int $offset:

int $whence:

Return value

bool

Overrides FileContent::seek

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php, line 53

Class

SeekableFileContent
Default implementation for file contents based on simple strings.

Namespace

org\bovigo\vfs\content

Code

public function seek($offset, $whence) {
  switch ($whence) {
    case SEEK_CUR:
      $this->offset += $offset;
      return true;
    case SEEK_END:
      $this->offset = $this
        ->size() + $offset;
      return true;
    case SEEK_SET:
      $this->offset = $offset;
      return true;
    default:
      return false;
  }
  return false;
}