code: private static byte doEncodeOpcode(byte b, WsMessage message) {
          switch (message.getKind()) {
          case TEXT: {
              b |= Opcode.TEXT.getCode();
              break;
          }
          case BINARY: {
              b |= Opcode.BINARY.getCode();
              break;
          }
          case PING: {
              b |= Opcode.PING.getCode();
              break;
          }
          case PONG: {
              b |= Opcode.PONG.getCode();
              break;
          }
          case CLOSE: {
              b |= Opcode.CLOSE.getCode();
              break;
          }
          default:
              throw new IllegalArgumentException("Unrecognized frame type: " + message.getKind());
          }
          return b;
      }
docs: Encode a WebSocket opcode onto a byte that might have some high bits set.
  
  @param b
  @param message
  @return