public function getBytes($approx = false)
    {
        if ($this->getPrimaryType() == 'multipart') {
            if (isset($this->_bytes)) {
                return $this->_bytes;
            }

            $bytes = 0;
            foreach ($this as $part) {
                $bytes += $part->getBytes($approx);
            }
            return $bytes;
        }

        if ($this->_contents) {
            fseek($this->_contents, 0, SEEK_END);
            $bytes = ftell($this->_contents);
        } else {
            $bytes = $this->_bytes;

            /* Base64 transfer encoding is approx. 33% larger than original
             * data size (RFC 2045 [6.8]). */
            if ($approx && ($this->_transferEncoding == 'base64')) {
                $bytes *= 0.75;
            }
        }

        return intval($bytes);
    }
public function getBytes($approx = false)
    {
        if ($this->getPrimaryType() == 'multipart') {
            if (isset($this->_bytes)) {
                return $this->_bytes;
            }

            $bytes = 0;
            foreach ($this as $part) {
                $bytes += $part->getBytes($approx);
            }
            return $bytes;
        }

        if ($this->_contents) {
            fseek($this->_contents, 0, SEEK_END);
            $bytes = ftell($this->_contents);
        } else {
            $bytes = $this->_bytes;

            /* Base64 transfer encoding is approx. 33% larger than original
             * data size (RFC 2045 [6.8]). */
            if ($approx && ($this->_transferEncoding == 'base64')) {
                $bytes *= 0.75;
            }
        }

        return intval($bytes);
    }
public function getBytes ( $ approx = false ) { if ( $ this -> getPrimaryType ( ) == 'multipart' ) { if ( isset ( $ this -> _bytes ) ) { return $ this -> _bytes ; } $ bytes = 0 ; foreach ( $ this as $ part ) { $ bytes += $ part -> getBytes ( $ approx ) ; } return $ bytes ; } if ( $ this -> _contents ) { fseek ( $ this -> _contents , 0 , SEEK_END ) ; $ bytes = ftell ( $ this -> _contents ) ; } else { $ bytes = $ this -> _bytes ; /* Base64 transfer encoding is approx. 33% larger than original
             * data size (RFC 2045 [6.8]). */ if ( $ approx && ( $ this -> _transferEncoding == 'base64' ) ) { $ bytes *= 0.75 ; } } return intval ( $ bytes ) ; }
Determine the size of this MIME part and its child members.

@todo Remove $approx parameter.

@param boolean $approx  If true, determines an approximate size for
parts consisting of base64 encoded data.

@return integer  Size of the part, in bytes.
Determine the size of this MIME part and its child members .