/**
   * Sends a message on the opened OutputStream. In case of an error the state is sent to the
   * handler.
   *
   * @param message, the message as a byte array
   */
  private void sendMessageAndState(byte[] message) {
    if (nxtOutputStream == null) return;

    try {
      sendMessage(message);
    } catch (IOException e) {
      sendState(STATE_SENDERROR);
    }
  }