public BytesWithIndex(Bytes<?> bytes, long index) { this.bytes = Bytes.allocateElasticDirect(bytes.readRemaining()).write(bytes); this.index = index; }
long time1 = mid - start; Bytes bytes = Bytes.allocateElasticDirect(64); try (ChronicleQueue q = SingleChronicleQueueBuilder.binary(base) .rollCycle(RollCycles.LARGE_HOURLY_XSPARSE)
long time1 = mid - start; Bytes bytes = Bytes.allocateElasticDirect(64); try (ChronicleQueue q = ChronicleQueue.singleBuilder(base) .rollCycle(RollCycles.LARGE_HOURLY_XSPARSE)
@NotNull protected Bytes createBytes() { NativeBytes<Void> bytes = Bytes.allocateElasticDirect(256); assert BytesUtil.unregister(bytes); return bytes; } }
static Bytes<?> allocateDefaultElasticBytes(long bytesCapacity) { if (bytesCapacity <= Bytes.MAX_BYTE_BUFFER_CAPACITY) { return Bytes.elasticHeapByteBuffer((int) bytesCapacity); } else { return Bytes.allocateElasticDirect(bytesCapacity); } } }
public Bytes text() { if (bytes == null) bytes = Bytes.allocateElasticDirect(); else bytes.clear(); message = (M) bytes; return 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); } }