def purge(self):
    self._buffer.seek(0)
    self._buffer.truncate()
    self.bytes_written = 0
    self.bytes_read = 0
def purge(self):
    self._buffer.seek(0)
    self._buffer.truncate()
    self.bytes_written = 0
    self.bytes_read = 0