'Return current buffer as whole string.'

def getvalue(self):

    with self._lock:
        if (self._val is not None):
            return self._val
        for record in self._recs:
            self.__write(record)
        self._recs = list()
        self._val = self._strm.getvalue()
        return self._val
