function write($content, $inByte = null)
    {
        $this->_assertWritable();

        $stream = $this->resource()->getRHandler();

        $inByte = ($inByte === null)
            ? $this->getBuffer()
            : $inByte;


        $content = (string) $content;
        if (null === $inByte)
            $ret = fwrite($stream, $content);
        else
            $ret = fwrite($stream, $content, $inByte);

        if (false === $ret)
            throw new \RuntimeException('Cannot write on stream.');

        $transCount = $inByte;
        if ($transCount === null) {
            if (function_exists('mb_strlen'))
                $transCount = mb_strlen($content, '8bit');
            else
                $transCount = strlen($content);
        }

        $this->_resetTransCount($transCount);
        return $this;
    }
function write($content, $inByte = null)
    {
        $this->_assertWritable();

        $stream = $this->resource()->getRHandler();

        $inByte = ($inByte === null)
            ? $this->getBuffer()
            : $inByte;


        $content = (string) $content;
        if (null === $inByte)
            $ret = fwrite($stream, $content);
        else
            $ret = fwrite($stream, $content, $inByte);

        if (false === $ret)
            throw new \RuntimeException('Cannot write on stream.');

        $transCount = $inByte;
        if ($transCount === null) {
            if (function_exists('mb_strlen'))
                $transCount = mb_strlen($content, '8bit');
            else
                $transCount = strlen($content);
        }

        $this->_resetTransCount($transCount);
        return $this;
    }
function write ( $ content , $ inByte = null ) { $ this -> _assertWritable ( ) ; $ stream = $ this -> resource ( ) -> getRHandler ( ) ; $ inByte = ( $ inByte === null ) ? $ this -> getBuffer ( ) : $ inByte ; $ content = ( string ) $ content ; if ( null === $ inByte ) $ ret = fwrite ( $ stream , $ content ) ; else $ ret = fwrite ( $ stream , $ content , $ inByte ) ; if ( false === $ ret ) throw new \ RuntimeException ( 'Cannot write on stream.' ) ; $ transCount = $ inByte ; if ( $ transCount === null ) { if ( function_exists ( 'mb_strlen' ) ) $ transCount = mb_strlen ( $ content , '8bit' ) ; else $ transCount = strlen ( $ content ) ; } $ this -> _resetTransCount ( $ transCount ) ; return $ this ; }
Writes the contents of string to the file stream

@param string $content The string that is to be written
@param int    $inByte  Writing will stop after length bytes
have been written or the end of string
is reached

@return $this
Writes the contents of string to the file stream