def bio_write(self, buf):
buf = _text_to_bytes_and_warn("<STR_LIT>", buf)<EOL>if self._into_ssl is None:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>result = _lib.BIO_write(self._into_ssl, buf, len(buf))<EOL>if result <= <NUM_LIT:0>:<EOL><INDENT>self._handle_bio_errors(self._into_ssl, result)<EOL><DEDENT>return result<EOL>
If the Connection was created with a memory BIO, this method can be
used to add bytes to the read end of that memory BIO.  The Connection
can then read the bytes (for example, in response to a call to
:meth:`recv`).

:param buf: The string to put into the memory BIO.
:return: The number of bytes written