com.google.android.exoplayer2.util.Util.toUpperInvariant()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中com.google.android.exoplayer2.util.Util.toUpperInvariant()方法的一些代码示例,展示了Util.toUpperInvariant()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.toUpperInvariant()方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称:Util
方法名:toUpperInvariant

Util.toUpperInvariant介绍

[英]Converts text to upper case using Locale#US.
[中]使用Locale#US将文本转换为大写。

代码示例

代码示例来源:origin: google/ExoPlayer

/**
 * Sets the initial bitrate estimates to the default values of the specified country. The
 * initial estimates are used when a bandwidth estimate is unavailable.
 *
 * @param countryCode The ISO 3166-1 alpha-2 country code of the country whose default bitrate
 *     estimates should be used.
 * @return This builder.
 */
public Builder setInitialBitrateEstimate(String countryCode) {
 initialBitrateEstimates =
   getInitialBitrateEstimatesForCountry(Util.toUpperInvariant(countryCode));
 return this;
}

代码示例来源:origin: google/ExoPlayer

/**
 * Returns the upper-case ISO 3166-1 alpha-2 country code of the current registered operator's MCC
 * (Mobile Country Code), or the country code of the default Locale if not available.
 *
 * @param context A context to access the telephony service. If null, only the Locale can be used.
 * @return The upper-case ISO 3166-1 alpha-2 country code, or an empty String if unavailable.
 */
public static String getCountryCode(@Nullable Context context) {
 if (context != null) {
  TelephonyManager telephonyManager =
    (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
  if (telephonyManager != null) {
   String countryCode = telephonyManager.getNetworkCountryIso();
   if (!TextUtils.isEmpty(countryCode)) {
    return toUpperInvariant(countryCode);
   }
  }
 }
 return toUpperInvariant(Locale.getDefault().getCountry());
}

代码示例来源:origin: google/ExoPlayer

if (objectTypeString.length() >= 2) {
 try {
  String objectTypeHexString = Util.toUpperInvariant(objectTypeString.substring(0, 2));
  int objectTypeInt = Integer.parseInt(objectTypeHexString, 16);
  mimeType = getMimeTypeFromMp4ObjectType(objectTypeInt);

代码示例来源:origin: google/ExoPlayer

assertThat(Util.toUpperInvariant(segment.encryptionIV)).isEqualTo("A7A");
assertThat(segment.byterangeLength).isEqualTo(51740);
assertThat(segment.byterangeOffset).isEqualTo(2147586650L);
assertThat(Util.toUpperInvariant(segment.encryptionIV)).isEqualTo("A7B");
assertThat(segment.byterangeLength).isEqualTo(C.LENGTH_UNSET);
assertThat(segment.byterangeOffset).isEqualTo(0);

相关文章