code: @Override
      public synchronized boolean send(final Object message,
                                       final boolean shouldClose,
                                       final OnComplete onComplete) throws IOException {
          if (!isOpen()) {
              return false;
          }
  
          this.sendQueued = true;
  
          byte[] data;
          if (message == null) {
              data = null;
          } else if (message instanceof String) {
              data = ((String)message).getBytes(getResponseCharset());
          } else if (message instanceof byte[]) {
              data = (byte[])message;
          } else {
              throw WebsocketUtil.wrongMessageType(message.getClass());
          }
  
          enqueue(new PendingSend(data, shouldClose, onComplete));
  
          return true;
      }
docs: message must be String or byte[]. Allowing Object makes life easier from clojure