net.openhft.chronicle.bytes.Bytes.readFloat()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(91)

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

Bytes.readFloat介绍

暂无

代码示例

代码示例来源:origin: OpenHFT/Chronicle-Queue

static void readMany(Bytes bytes, int size) {
  for (int i = 0; i < size; i += 32) {
    s32 = bytes.readInt();// 4 bytes
    f32 = bytes.readFloat();// 4 bytes
    s64 = bytes.readLong();// 8 bytes
    f64 = bytes.readDouble();// 8 bytes
    s = bytes.readUtf8(); // 8 bytes
    assertEquals("Hello!!", s);
  }
}

代码示例来源:origin: com.wavefront/proxy

@NotNull
@Override
public AgentDigest read(Bytes in, long size, @Nullable AgentDigest using) {
 Preconditions.checkArgument(size >= FIXED_SIZE);
 short compression = in.readShort();
 if (using == null || using.compression != compression) {
  using = new AgentDigest(compression, in.readLong());
 } else {
  using.dispatchTimeMillis = in.readLong();
 }
 using.totalWeight = 0d;
 using.lastUsedCell = (int) ((size - FIXED_SIZE) / PER_CENTROID_SIZE);
 using.tempUsed = 0;
 using.unmergedWeight = 0D;
 // need explicit nulling of weight past lastUsedCell
 Arrays.fill(using.weight, using.lastUsedCell, using.weight.length, 0D);
 for (int i = 0; i < using.lastUsedCell; ++i) {
  float weight = in.readFloat();
  using.weight[i] = weight;
  using.mean[i] = in.readFloat();
  using.totalWeight += weight;
 }
 return using;
}

代码示例来源:origin: wavefrontHQ/java

@NotNull
@Override
public AgentDigest read(Bytes in, long size, @Nullable AgentDigest using) {
 Preconditions.checkArgument(size >= FIXED_SIZE);
 short compression = in.readShort();
 if (using == null || using.compression != compression) {
  using = new AgentDigest(compression, in.readLong());
 } else {
  using.dispatchTimeMillis = in.readLong();
 }
 using.totalWeight = 0d;
 using.lastUsedCell = (int) ((size - FIXED_SIZE) / PER_CENTROID_SIZE);
 using.tempUsed = 0;
 using.unmergedWeight = 0D;
 // need explicit nulling of weight past lastUsedCell
 Arrays.fill(using.weight, using.lastUsedCell, using.weight.length, 0D);
 for (int i = 0; i < using.lastUsedCell; ++i) {
  float weight = in.readFloat();
  using.weight[i] = weight;
  using.mean[i] = in.readFloat();
  using.totalWeight += weight;
 }
 return using;
}

相关文章

微信公众号

最新文章

更多