public function stream_write($data)
{
if (self::READONLY === $this->mode) {
return 0;
}
if ($this->content->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) {
return 0;
}
if (self::$quota->isLimited()) {
$data = substr($data, 0, self::$quota->spaceLeft(self::$root->sizeSummarized()));
}
return $this->content->write($data);
}