本文整理了Java中okio.Buffer.rangeEquals()
方法的一些代码示例,展示了Buffer.rangeEquals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.rangeEquals()
方法的具体详情如下:
包路径:okio.Buffer
类名称:Buffer
方法名:rangeEquals
暂无
代码示例来源:origin: Tickaroo/tikxml
/**
* Checks for CDATA beginning {@code <![CDATA[ }. This method doesn't consume the opening CDATA
* Tag
*
* @return true, if CDATA opening tag, otherwise false
* @throws IOException
*/
private boolean isCDATA() throws IOException {
return buffer.rangeEquals(0, CDATA_OPEN);
}
代码示例来源:origin: huxq17/tractor
private boolean rangeEquals(long offset, ByteString bytes) throws IOException {
return request(offset + bytes.size()) && buffer.rangeEquals(offset, bytes);
}
代码示例来源:origin: huxq17/tractor
@Override public long indexOf(ByteString bytes, long fromIndex) throws IOException {
if (bytes.size() == 0) throw new IllegalArgumentException("bytes is empty");
while (true) {
fromIndex = indexOf(bytes.getByte(0), fromIndex);
if (fromIndex == -1) {
return -1;
}
if (rangeEquals(fromIndex, bytes)) {
return fromIndex;
}
fromIndex++;
}
}
内容来源于网络,如有侵权,请联系作者删除!