code: private static byte doEncodeOpcode(byte b, WsMessage message) {
          Kind kind = message.getKind();
  
          switch (kind) {
          case CONTINUATION:
              b |= Opcode.CONTINUATION.getCode();
              break;
          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 IllegalStateException("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