<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def buffered_write(self, buf):
 """Appends a bytes like object to the transport write buffer. Raises BufferOverflowError if buf would cause the buffer to grow beyond the specified maximum. buf -- bytes to send """

        if self.closed:
            raise ConnectionClosed()

        if len(buf) + len(self.write_buffer) > self.max_size:
            raise BufferOverflowError()
        else:
            self.write_buffer.extend(buf)