public function length($utf8 = false)
    {
        $pos = $this->pos();

        if ($utf8 && $this->_utf8_char) {
            $this->rewind();
            $len = 0;
            while ($this->getChar() !== false) {
                ++$len;
            }
        } elseif (!$this->end()) {
            throw new Horde_Stream_Exception('ERROR');
        } else {
            $len = $this->pos();
        }

        if (!$this->seek($pos, false)) {
            throw new Horde_Stream_Exception('ERROR');
        }

        return $len;
    }
public function length($utf8 = false)
    {
        $pos = $this->pos();

        if ($utf8 && $this->_utf8_char) {
            $this->rewind();
            $len = 0;
            while ($this->getChar() !== false) {
                ++$len;
            }
        } elseif (!$this->end()) {
            throw new Horde_Stream_Exception('ERROR');
        } else {
            $len = $this->pos();
        }

        if (!$this->seek($pos, false)) {
            throw new Horde_Stream_Exception('ERROR');
        }

        return $len;
    }
public function length ( $ utf8 = false ) { $ pos = $ this -> pos ( ) ; if ( $ utf8 && $ this -> _utf8_char ) { $ this -> rewind ( ) ; $ len = 0 ; while ( $ this -> getChar ( ) !== false ) { ++ $ len ; } } elseif ( ! $ this -> end ( ) ) { throw new Horde_Stream_Exception ( 'ERROR' ) ; } else { $ len = $ this -> pos ( ) ; } if ( ! $ this -> seek ( $ pos , false ) ) { throw new Horde_Stream_Exception ( 'ERROR' ) ; } return $ len ; }
Returns the length of the data. Does not change the stream position.

@param boolean $utf8  If true, determines the UTF-8 length of the
stream (as of 1.4.0). If false, determines the
byte length of the stream.

@return integer  Stream size.

@throws Horde_Stream_Exception
Returns the length of the data . Does not change the stream position .