public void writeTo(Output output, BitToUserHandshake message) throws IOException {
    if (message.rpcVersion != 0) output.writeInt32(2, message.rpcVersion, false);

    if (message.status != null) output.writeEnum(3, message.status.number, false);

    if (message.errorId != null) output.writeString(4, message.errorId, false);

    if (message.errorMessage != null) output.writeString(5, message.errorMessage, false);
  }
  public void writeTo(Output output, UserToBitHandshake message) throws IOException {
    if (message.channel != null) output.writeEnum(1, message.channel.number, false);

    if (message.supportListening != null) output.writeBool(2, message.supportListening, false);

    if (message.rpcVersion != 0) output.writeInt32(3, message.rpcVersion, false);

    if (message.credentials != null)
      output.writeObject(4, message.credentials, UserCredentials.getSchema(), false);

    if (message.properties != null)
      output.writeObject(5, message.properties, UserProperties.getSchema(), false);

    if (message.supportComplexTypes != null
        && message.supportComplexTypes != DEFAULT_SUPPORT_COMPLEX_TYPES)
      output.writeBool(6, message.supportComplexTypes, false);

    if (message.supportTimeout != null && message.supportTimeout != DEFAULT_SUPPORT_TIMEOUT)
      output.writeBool(7, message.supportTimeout, false);

    if (message.clientInfos != null)
      output.writeObject(8, message.clientInfos, RpcEndpointInfos.getSchema(), false);
  }