class HttpConversionUtil {

  static void setHttp2Authority(final String authority, final Http2Headers out) {
    // The authority MUST NOT include the deprecated "userinfo" subcomponent
    if (authority != null) {
      if (authority.isEmpty()) {
        out.authority(EMPTY_STRING);
      } else {
        final int start = authority.indexOf('@') + 1;
        final int length = authority.length() - start;
        if (length == 0) {
          throw new IllegalArgumentException("authority: " + authority);
        }
        out.authority(new AsciiString(authority, start, length));
      }
    }
  }

  private  HttpConversionUtil();

}