Interface RemoteEndpoint.Basic

    • Method Detail

      • sendText

        void sendText​(java.lang.String text)
               throws java.io.IOException
        Send the message, blocking until the message is sent.
        Parameters:
        text - The text message to send.
        Throws:
        java.lang.IllegalArgumentException - if text is null.
        java.io.IOException - if an I/O error occurs during the sending of the message.
      • sendBinary

        void sendBinary​(java.nio.ByteBuffer data)
                 throws java.io.IOException
        Send the message, blocking until the message is sent.
        Parameters:
        data - The binary message to send
        Throws:
        java.lang.IllegalArgumentException - if data is null.
        java.io.IOException - if an I/O error occurs during the sending of the message.
      • sendText

        void sendText​(java.lang.String fragment,
                      boolean isLast)
               throws java.io.IOException
        Sends part of a text message to the remote endpoint. Once the first part of a message has been sent, no other text or binary messages may be sent until all remaining parts of this message have been sent.
        Parameters:
        fragment - The partial message to send
        isLast - true if this is the last part of the message, otherwise false
        Throws:
        java.lang.IllegalArgumentException - if fragment is null.
        java.io.IOException - if an I/O error occurs during the sending of the message.
      • sendBinary

        void sendBinary​(java.nio.ByteBuffer partialByte,
                        boolean isLast)
                 throws java.io.IOException
        Sends part of a binary message to the remote endpoint. Once the first part of a message has been sent, no other text or binary messages may be sent until all remaining parts of this message have been sent.
        Parameters:
        partialByte - The partial message to send
        isLast - true if this is the last part of the message, otherwise false
        Throws:
        java.lang.IllegalArgumentException - if partialByte is null.
        java.io.IOException - if an I/O error occurs during the sending of the message.
      • getSendStream

        java.io.OutputStream getSendStream()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getSendWriter

        java.io.Writer getSendWriter()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • sendObject

        void sendObject​(java.lang.Object data)
                 throws java.io.IOException,
                        EncodeException
        Encodes object as a message and sends it to the remote endpoint.
        Parameters:
        data - The object to be sent.
        Throws:
        EncodeException - if there was a problem encoding the data object as a websocket message.
        java.lang.IllegalArgumentException - if data is null.
        java.io.IOException - if an I/O error occurs during the sending of the message.