title: Java Websocket client lib issue: nv-websocket-client sendBinary
body: <p>When using sendBinary of this lib from client I got all 0 in the server ;(</p>
  
  <p>this page asks me to to add more description but the code bellow is simple and straight forward and should be self explainable...</p>
  
  <p>client side code:</p>
  
  <pre><code>private WebSocket connect() throws IOException, WebSocketException {
      return new WebSocketFactory()
              .setConnectionTimeout(5000)
              .createSocket("ws://localhost:8080/testwsapp2/endpoint")
              .addListener(new WebSocketAdapter() {
                  public void onBinaryMessage(WebSocket websocket, byte[] message) {
  
                      String strmsg = new String(message, StandardCharsets.US_ASCII);
                      System.out.println("message from server: " + strmsg);
  
                      //echo back
                      try {
                          strmsg = "echo: " + strmsg;
                          System.out.println("now echo back with \"" + strmsg + "\"");
  
                          byte[] bytemsg = strmsg.getBytes("US-ASCII");
                          System.out.println("echo message length = " + bytemsg.length);
  
                          String a2sview = Arrays.toString(bytemsg);
                          System.out.println("echo message a2sview: " + a2sview);
  
                          websocket.sendBinary(bytemsg);
                      } catch (Exception ex) {
                          System.out.println(ex.getMessage());
                      }
  
                  }
              })
              .addExtension(WebSocketExtension.PERMESSAGE_DEFLATE)
              .connect();
  }
  </code></pre>
  
  <p>server side code:</p>
  
  <pre><code>@OnOpen
  public void on_open(Session session) {
      try {
          byte[] bytemsg = ("hello client").getBytes("US-ASCII");
          session.getBasicRemote().sendBinary(ByteBuffer.wrap(bytemsg));
      } catch (Exception ex) {
          System.out.println(ex.getMessage());
      }
  }
  
  @OnMessage
  public void on_message(Session session, ByteBuffer message) {
  
      byte[] bytemsg = new byte[message.remaining()];
      System.out.println("client message length = " + bytemsg.length);
  
      String a2sview = Arrays.toString(bytemsg);
      System.out.println("client message a2sview: " + a2sview);
  
      String strmsg = new String(bytemsg, StandardCharsets.US_ASCII);
      System.out.println("client message: " + strmsg);
  
  }
  </code></pre>
  
  <p>client output:</p>
  
  <pre><code>message from server: hello client
  now echo back with "echo: hello client"
  echo message length = 18
  echo message a2sview: [101, 99, 104, 111, 58, 32, 104, 101, 108, 108, 111, 32, 99, 108, 105, 101, 110, 116]
  </code></pre>
  
  <p>server output</p>
  
  <pre><code>Info:   client message length = 18
  Info:   client message a2sview: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  Info:   client message:
  </code></pre>
  
  <p>Thank you very much for help.</p>