'Sends a command to the JVM. This method is not intended to be
called directly by Py4J users: it is usually called by JavaMember
instances.
:param command: the `string` command to send to the JVM. The command
must follow the Py4J protocol.
:rtype: the `string` answer received from the JVM. The answer follows
the Py4J protocol.'

def send_command(self, command):

    logger.debug(u'Command    to    send:    {0}'.format(command))
    try:
        self.socket.sendall(command.encode(u'utf-8'))
        answer = smart_decode(self.stream.readline()[:(-1)])
        logger.debug(u'Answer    received:    {0}'.format(answer))
        if (answer.strip() == u''):
            self.close()
            raise Py4JError(u'Answer    from    Java    side    is    empty')
        return answer
    except Exception as e:
        logger.exception(u'Error    while    sending    or    receiving.')
        raise Py4JNetworkError(u'Error    while    sending    or    receiving', e)
