service/components/contents/ContentStream.php
/**
     * Writes data to stream
     *
     * @param  string  $data   data to write
     * @param  integer $offset
     * @return integer|boolean
     */
Writes data to stream
@param  string  $data   data to write
@param  integer $offset
@return integer|boolean
Writes data to stream @param string $data data to write @param integer $offset @return integer|boolean
public function write($data, $offset = -1)
    {
        if (!$this->isWritable()) {
            throw new Exception('Stream is not writable.');
        }
        $stream = $this->getResource();
        if ($offset != -1) {
            if (fseek($stream, 0, $offset) == -1) {
                return 0;
            }
        }
        return fwrite($stream, $data);
    }
public function write ( $ data , $ offset = - 1 ) { if ( ! $ this -> isWritable ( ) ) { throw new Exception ( 'Stream is not writable.' ) ; } $ stream = $ this -> getResource ( ) ; if ( $ offset != - 1 ) { if ( fseek ( $ stream , 0 , $ offset ) == - 1 ) { return 0 ; } } return fwrite ( $ stream , $ data ) ; }
Writes data to stream
 @param  string  $data   data to write
 @param  integer $offset
 @return integer|boolean
Writes data to stream @param string $data data to write @param integer $offset @return integer|boolean