/**
* Write stream
*
* @param string $data The data to write to the stream.
*
* @return integer
*
* @see streamWrapper::stream_write
* @since 1.7.0
*/
public function stream_write($data)
{
$left = substr($this->buffers[$this->name], 0, $this->position);
$right = substr($this->buffers[$this->name], $this->position + \strlen($data));
$this->buffers[$this->name] = $left . $data . $right;
$this->position += \strlen($data);
return \strlen($data);
}