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

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

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

Bytes.allocateElasticDirect介绍

[英]Allocate an elastic buffer with initially no size.
[中]分配一个最初没有大小的弹性缓冲区。

代码示例

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

public BytesWithIndex(Bytes<?> bytes, long index) {
  this.bytes = Bytes.allocateElasticDirect(bytes.readRemaining()).write(bytes);
  this.index = index;
}

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

long time1 = mid - start;
Bytes bytes = Bytes.allocateElasticDirect(64);
try (ChronicleQueue q = SingleChronicleQueueBuilder.binary(base)
    .rollCycle(RollCycles.LARGE_HOURLY_XSPARSE)

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

long time1 = mid - start;
Bytes bytes = Bytes.allocateElasticDirect(64);
try (ChronicleQueue q = ChronicleQueue.singleBuilder(base)
    .rollCycle(RollCycles.LARGE_HOURLY_XSPARSE)

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

@NotNull
  protected Bytes createBytes() {
    NativeBytes<Void> bytes = Bytes.allocateElasticDirect(256);
    assert BytesUtil.unregister(bytes);
    return bytes;
  }
}

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

static Bytes<?> allocateDefaultElasticBytes(long bytesCapacity) {
    if (bytesCapacity <= Bytes.MAX_BYTE_BUFFER_CAPACITY) {
      return Bytes.elasticHeapByteBuffer((int) bytesCapacity);
    } else {
      return Bytes.allocateElasticDirect(bytesCapacity);
    }
  }
}

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

public Bytes text() {
  if (bytes == null)
    bytes = Bytes.allocateElasticDirect();
  else
    bytes.clear();
  message = (M) bytes;
  return bytes;
}

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

public static BytesStore<Bytes<Void>, Void> copyOf(@NotNull Bytes bytes) {
  long remaining = bytes.readRemaining();
  NativeBytes<Void> bytes2;
  try {
    bytes2 = Bytes.allocateElasticDirect(remaining);
    bytes2.write(bytes, 0, remaining);
    return bytes2;
  } catch (IllegalArgumentException | BufferOverflowException | BufferUnderflowException e) {
    throw new AssertionError(e);
  }
}

相关文章

微信公众号

最新文章

更多