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

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

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

Bytes.append8bit介绍

暂无

代码示例

代码示例来源:origin: net.openhft/chronicle-engine

@Override
public boolean put(String key, @NotNull String value) {
  Buffers b = BUFFERS.get();
  Bytes<ByteBuffer> bytes = b.valueBuffer;
  bytes.clear();
  bytes.append8bit(value);
  return kvStore.put(key, bytes);
}

代码示例来源:origin: net.openhft/chronicle-engine

private void dumpRules(@NotNull Wire wire) {
  wire.bytes().append8bit("---\n");
  wire.write("name").text(fullName())
      .write("leaf").marshallable(w -> {
    for (@NotNull Map.Entry<Class, LeafView> entry : leafViewMap.entrySet()) {
      w.writeEvent(Class.class, entry.getKey()).leaf(false)
          .text(entry.getValue().name);
    }
  })
      .write("wrapping").marshallable(w -> {
    for (@NotNull Map.Entry<Class, SortedMap<String, WrappingViewRecord>> entry : wrappingViewFactoryMap.entrySet()) {
      w.writeEvent(Class.class, entry.getKey()).marshallable(ww -> {
        for (@NotNull Map.Entry<String, WrappingViewRecord> recordEntry : entry.getValue().entrySet()) {
          ww.writeEventName(recordEntry.getKey()).object(Class.class, recordEntry.getValue().underlyingType);
        }
      });
    }
  });
}

代码示例来源:origin: net.openhft/chronicle-bytes

MappedUniqueMicroTimeProvider() {
  try {
    file = MappedFile.mappedFile(OS.TMP + "/.time-stamp.dat", OS.pageSize(), 0);
    bytes = file.acquireBytesForWrite(0);
    bytes.append8bit("&TSF\nTime stamp file uses for sharing a unique id\n");
    BytesUtil.unregister(bytes);
  } catch (IOException ioe) {
    throw new IORuntimeException(ioe);
  }
}

代码示例来源:origin: peter-lawrey/Performance-Examples

private static void testBytes() {
    Bytes bytes = Bytes.allocateDirect(32);
    long start = System.currentTimeMillis();
    int count = 500000;
    for (int i = 0; i < count; i++) {
      bytes.clear();
      String s = "a,b,c,d,1,2,3,4";
      bytes.append8bit(s);
      a = bytes.parseUtf8(StopCharTesters.COMMA_STOP);
      b = bytes.parseUtf8(StopCharTesters.COMMA_STOP);
      c = bytes.parseUtf8(StopCharTesters.COMMA_STOP);
      d = bytes.parseUtf8(StopCharTesters.COMMA_STOP);
      e = (int) bytes.parseLong();
      f = (int) bytes.parseLong();
      g = (int) bytes.parseLong();
      h = (int) bytes.parseLong();
    }
    long time = (System.currentTimeMillis() - start) * 100000 / count;
    System.out.println("Bytes: Average time " + time / 1e2 + "us.");
  }
}

相关文章

微信公众号

最新文章

更多