@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
try { MappedBytes bytes = MappedBytes.mappedBytes(file, 4 << 20, OS.pageSize(), !OS.isWindows()); bytes.readLimit(bytes.realCapacity()); StringBuilder sb = new StringBuilder(); WireDumper dumper = WireDumper.of(bytes);
public void checkFileContents(@NotNull File file, String expected) throws FileNotFoundException { @NotNull MappedBytes bytes = MappedBytes.mappedBytes(file, ChronicleQueue.TEST_BLOCK_SIZE); bytes.readLimit(bytes.realCapacity()); assertEquals(expected, Wires.fromSizePrefixedBlobs(bytes)); bytes.release(); }
try { MappedBytes bytes = MappedBytes.mappedBytes(file, 4 << 20); bytes.readLimit(bytes.realCapacity());
try { mappedBytes.readPosition(0); mappedBytes.readLimit(mappedBytes.realCapacity()); while (mappedWire.readDataHeader()) { int header = mappedBytes.readVolatileInt();
@NotNull @Override public Bytes<Void> readSkip(long bytesToSkip) throws BufferUnderflowException { if (readPosition + bytesToSkip > readLimit()) throw new BufferUnderflowException(); long check = bytesToSkip >= 0 ? this.readPosition : this.readPosition + bytesToSkip; if (bytesStore instanceof NoBytesStore || bytesToSkip != (int) bytesToSkip || !bytesStore.inside(readPosition, (int) bytesToSkip)) { acquireNextByteStore0(check, false); } this.readPosition += bytesToSkip; return this; }
private synchronized void acquireNextByteStore0(final long offset, final boolean set) { @Nullable BytesStore oldBS = this.bytesStore; try { @Nullable BytesStore newBS = mappedFile.acquireByteStore(offset); this.bytesStore = newBS; oldBS.release(); } catch (@NotNull IOException | IllegalStateException | IllegalArgumentException e) { @NotNull BufferOverflowException boe = new BufferOverflowException(); boe.initCause(e); throw boe; } if (set) { if (writeLimit() < readPosition) writeLimit(readPosition); if (readLimit() < readPosition) readLimit(readPosition); readPosition = offset; } }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
@NotNull @Override public Bytes<Void> readPositionRemaining(long position, long remaining) throws BufferUnderflowException { long limit = position + remaining; acquireNextByteStore(position, true); if (writeLimit < limit) writeLimit(limit); boolean debug = false; assert debug = true; if (debug) readLimit(limit); else uncheckedWritePosition(limit); return readPosition(position); }
try { MappedBytes bytes = MappedBytes.mappedBytes(file, 4 << 20, OS.pageSize(), !OS.isWindows()); bytes.readLimit(bytes.realCapacity()); StringBuilder sb = new StringBuilder(); WireDumper dumper = WireDumper.of(bytes);
try { mappedBytes.readPosition(0); mappedBytes.readLimit(mappedBytes.realCapacity()); while (mappedWire.readDataHeader()) { int header = mappedBytes.readVolatileInt();