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

Breadcrumb

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

function LargeFileContent::doWrite

actual writing of data with specified length at given offset

Parameters

string $data:

int $offset:

int $length:

Overrides SeekableFileContent::doWrite

File

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

Class

LargeFileContent
File content implementation to mock large files.

Namespace

org\bovigo\vfs\content

Code

protected function doWrite($data, $offset, $length) {
    for ($i = 0; $i < $length; $i++) {
        $this->content[$i + $offset] = substr($data, $i, 1);
    }
    if ($offset >= $this->size) {
        $this->size += $length;
    }
    elseif ($offset + $length > $this->size) {
        $this->size = $offset + $length;
    }
}

API Navigation

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