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

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

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

Buffer.readHexadecimalUnsignedLong介绍

暂无

代码示例

代码示例来源:origin: io.zipkin/zipkin-java-server

@RequestMapping(value = "/trace/{traceId}", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
public byte[] getTrace(@PathVariable String traceId) {
 @SuppressWarnings("resource")
 long id = new Buffer().writeUtf8(traceId).readHexadecimalUnsignedLong();
 List<List<Span>> traces = spanStore.getTracesByIds(Collections.singletonList(id));
 if (traces.isEmpty()) {
  throw new TraceNotFoundException(traceId, id);
 }
 return jsonCodec.writeSpans(traces.get(0));
}

代码示例来源:origin: huxq17/tractor

@Override public long readHexadecimalUnsignedLong() throws IOException {
 require(1);
 for (int pos = 0; request(pos + 1); pos++) {
  byte b = buffer.getByte(pos);
  if ((b < '0' || b > '9') && (b < 'a' || b > 'f') && (b < 'A' || b > 'F')) {
   // Non-digit, or non-leading negative sign.
   if (pos == 0) {
    throw new NumberFormatException(String.format(
      "Expected leading [0-9a-fA-F] character but was %#x", b));
   }
   break;
  }
 }
 return buffer.readHexadecimalUnsignedLong();
}

相关文章