code: @Override
      public ByteBuffer getBinary() throws IOException {
          if (_messageType == null) {
              return null;
          }
  
          if (_messageType == WebSocketMessageType.EOS){
              String s = "End of stream has reached as the connection has been closed";
              throw new WebSocketException(s);
          }
  
          if (_messageType != WebSocketMessageType.BINARY) {
              String s = "Invalid WebSocketMessageType: Cannot decode the payload " +
                         "as a binary message";
              throw new WebSocketException(s);            
          }
      
          return ByteBuffer.wrap(((ByteBuffer)_payload).array());
      }
docs: --------------------- WebSocketMessageReader Implementation -----------