本文整理了Java中net.openhft.chronicle.bytes.Bytes.allocateElasticDirect()
方法的一些代码示例,展示了Bytes.allocateElasticDirect()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.allocateElasticDirect()
方法的具体详情如下:
包路径:net.openhft.chronicle.bytes.Bytes
类名称: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!