当前位置: 首页>>代码示例>>Java>>正文


Java Util.equal方法代码示例

本文整理汇总了Java中okhttp3.internal.Util.equal方法的典型用法代码示例。如果您正苦于以下问题:Java Util.equal方法的具体用法?Java Util.equal怎么用?Java Util.equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okhttp3.internal.Util的用法示例。


在下文中一共展示了Util.equal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: equals

import okhttp3.internal.Util; //导入方法依赖的package包/类
@Override public boolean equals(Object other) {
  if (!(other instanceof Handshake)) return false;
  Handshake that = (Handshake) other;
  return Util.equal(cipherSuite, that.cipherSuite)
      && cipherSuite.equals(that.cipherSuite)
      && peerCertificates.equals(that.peerCertificates)
      && localCertificates.equals(that.localCertificates);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:Handshake.java

示例2: equals

import okhttp3.internal.Util; //导入方法依赖的package包/类
@Override public boolean equals(Object o) {
  return o instanceof Challenge
      && Util.equal(scheme, ((Challenge) o).scheme)
      && Util.equal(realm, ((Challenge) o).realm);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:Challenge.java

示例3: writeHeaders

import okhttp3.internal.Util; //导入方法依赖的package包/类
/** This does not use "never indexed" semantics for sensitive headers. */
// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-12#section-6.2.3
void writeHeaders(List<Header> headerBlock) throws IOException {
  if (emitDynamicTableSizeUpdate) {
    if (smallestHeaderTableSizeSetting < maxDynamicTableByteCount) {
      // Multiple dynamic table size updates!
      writeInt(smallestHeaderTableSizeSetting, PREFIX_5_BITS, 0x20);
    }
    emitDynamicTableSizeUpdate = false;
    smallestHeaderTableSizeSetting = Integer.MAX_VALUE;
    writeInt(maxDynamicTableByteCount, PREFIX_5_BITS, 0x20);
  }

  for (int i = 0, size = headerBlock.size(); i < size; i++) {
    Header header = headerBlock.get(i);
    ByteString name = header.name.toAsciiLowercase();
    ByteString value = header.value;
    int headerIndex = -1;
    int headerNameIndex = -1;

    Integer staticIndex = NAME_TO_FIRST_INDEX.get(name);
    if (staticIndex != null) {
      headerNameIndex = staticIndex + 1;
      if (headerNameIndex > 1 && headerNameIndex < 8) {
        // Only search a subset of the static header table. Most entries have an empty value, so
        // it's unnecessary to waste cycles looking at them. This check is built on the
        // observation that the header entries we care about are in adjacent pairs, and we
        // always know the first index of the pair.
        if (Util.equal(STATIC_HEADER_TABLE[headerNameIndex - 1].value, value)) {
          headerIndex = headerNameIndex;
        } else if (Util.equal(STATIC_HEADER_TABLE[headerNameIndex].value, value)) {
          headerIndex = headerNameIndex + 1;
        }
      }
    }

    if (headerIndex == -1) {
      for (int j = nextHeaderIndex + 1, length = dynamicTable.length; j < length; j++) {
        if (Util.equal(dynamicTable[j].name, name)) {
          if (Util.equal(dynamicTable[j].value, value)) {
            headerIndex = j - nextHeaderIndex + STATIC_HEADER_TABLE.length;
            break;
          } else if (headerNameIndex == -1) {
            headerNameIndex = j - nextHeaderIndex + STATIC_HEADER_TABLE.length;
          }
        }
      }
    }

    if (headerIndex != -1) {
      // Indexed Header Field.
      writeInt(headerIndex, PREFIX_7_BITS, 0x80);
    } else if (headerNameIndex == -1) {
      // Literal Header Field with Incremental Indexing - New Name.
      out.writeByte(0x40);
      writeByteString(name);
      writeByteString(value);
      insertIntoDynamicTable(header);
    } else if (name.startsWith(Header.PSEUDO_PREFIX) && !Header.TARGET_AUTHORITY.equals(name)) {
      // Follow Chromes lead - only include the :authority pseudo header, but exclude all other
      // pseudo headers. Literal Header Field without Indexing - Indexed Name.
      writeInt(headerNameIndex, PREFIX_4_BITS, 0);
      writeByteString(value);
    } else {
      // Literal Header Field with Incremental Indexing - Indexed Name.
      writeInt(headerNameIndex, PREFIX_6_BITS, 0x40);
      writeByteString(value);
      insertIntoDynamicTable(header);
    }
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:72,代码来源:Hpack.java

示例4: equals

import okhttp3.internal.Util; //导入方法依赖的package包/类
@Override public boolean equals(Object other) {
  return other instanceof Message
      && Util.equal(((Message) other).bytes, bytes)
      && Util.equal(((Message) other).string, string);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:WebSocketRecorder.java


注:本文中的okhttp3.internal.Util.equal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。