code: public void sendBinarySync(Session session, InputStream inputStream) throws IOException {
          if (session == null) {
              return;
          }
  
          if (inputStream == null) {
              throw new IllegalArgumentException("inputStream must not be null");
          }
  
          log.debugf("Attempting to send binary data to client [%s]", session.getId());
  
          if (session.isOpen()) {
              long size = new CopyStreamRunnable(session, inputStream).copyInputToOutput();
              log.debugf("Finished sending binary data to client [%s]: size=[%s]", session.getId(), size);
          }
  
          return;
      }
docs: Sends binary data to a client synchronously.
  
  @param session the client where the message will be sent
  @param inputStream the binary data to send
  @throws IOException if a problem occurred during delivery of the data to a session.