code: def flush (self, overlap=0):
          
          self.buf += self.empty.join(self.tmpbuf)
          self.tmpbuf = []
          if overlap and overlap < self.pos:
              data = self.buf[:-overlap]
              self.buf = self.buf[-overlap:]
          else:
              data = self.buf
              self.buf = self.empty
          return data
docs: Flush buffered data and return it.