okio.Buffer.rangeEquals()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(117)

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

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++;
 }
}

相关文章