You are here

public function AmazonS3StreamWrapper::stream_write in AmazonS3 7

Support for fwrite(), file_put_contents() etc.

Parameters

string $data: The string to be written.

Return value

int The number of bytes written.

Overrides StreamWrapperInterface::stream_write

See also

http://php.net/manual/en/streamwrapper.stream-write.php

File

./AmazonS3StreamWrapper.inc, line 534
Drupal stream wrapper implementation for Amazon S3

Class

AmazonS3StreamWrapper
@file Drupal stream wrapper implementation for Amazon S3

Code

public function stream_write($data) {
  $data_length = strlen($data);
  $this->buffer .= $data;
  $this->bufferLength += $data_length;
  $this->position += $data_length;
  return $data_length;
}