def size(self):
        """Returns:
        int : The total number of bytes that will be returned by the iterator.
        """
        if hasattr(self._stream, 'len'):
            return len(self._stream)
        elif hasattr(self._stream, 'fileno'):
            return os.fstat(self._stream.fileno()).st_size
        else:
            cur_pos = self._stream.tell()
            size = self._stream.seek(0, os.SEEK_END)
            self._stream.seek(cur_pos)
            return size
def size ( self ) : if hasattr ( self . _stream , 'len' ) : return len ( self . _stream ) elif hasattr ( self . _stream , 'fileno' ) : return os . fstat ( self . _stream . fileno ( ) ) . st_size else : cur_pos = self . _stream . tell ( ) size = self . _stream . seek ( 0 , os . SEEK_END ) self . _stream . seek ( cur_pos ) return size
Returns:
        int : The total number of bytes that will be returned by the iterator.