def write(self, data):
        self._bd.add(data)

        flushed = True
        while flushed and self._bd.byteSz > PIPE_BUF_BYTES:
            # Flush down to a small amount of buffered bytes as to
            # avoid memory-copy intensive defragmentations.
            #
            # The tradeoff being made here is the price of a syscall
            # (where larger buffers are better) vs. the price of
            # copying some memory.
            flushed = self._partial_flush(65535)
dataset/ETHPy150Open wal-e/wal-e/wal_e/pipebuf.py/NonBlockBufferedWriter.write/original