Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LargeFileContent.php

function LargeFileContent::doRead

actual reading of given byte count starting at given offset

Parameters

int $offset:

int $count:

Overrides SeekableFileContent::doRead

1 call to LargeFileContent::doRead()
LargeFileContent::content in vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/content/LargeFileContent.php
returns actual content

File

vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/content/LargeFileContent.php, line 109

Class

LargeFileContent
File content implementation to mock large files.

Namespace

org\bovigo\vfs\content

Code

protected function doRead($offset, $count) {
    if ($offset + $count > $this->size) {
        $count = $this->size - $offset;
    }
    $result = '';
    for ($i = 0; $i < $count; $i++) {
        if (isset($this->content[$i + $offset])) {
            $result .= $this->content[$i + $offset];
        }
        else {
            $result .= ' ';
        }
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal