本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
示例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);
}