Tabnine Logo
MappedBytes.readLimit
Code IndexAdd Tabnine to your IDE (free)

How to use
readLimit
method
in
net.openhft.chronicle.bytes.MappedBytes

Best Java code snippets using net.openhft.chronicle.bytes.MappedBytes.readLimit (Showing top 13 results out of 315)

origin: OpenHFT/Chronicle-Queue

@NotNull
@Override
public String dump() {
  MappedBytes bytes = MappedBytes.mappedBytes(mappedFile);
  try {
    bytes.readLimit(bytes.realCapacity());
    return Wires.fromSizePrefixedBlobs(bytes);
  } finally {
    bytes.release();
  }
}
origin: OpenHFT/Chronicle-Queue

@NotNull
@Override
public String dump() {
  MappedBytes bytes = MappedBytes.mappedBytes(mappedFile);
  try {
    bytes.readLimit(bytes.realCapacity());
    return Wires.fromSizePrefixedBlobs(bytes);
  } finally {
    bytes.release();
  }
}
origin: OpenHFT/Chronicle-Queue

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);
origin: OpenHFT/Chronicle-Queue

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();
}
origin: OpenHFT/Chronicle-Queue

try {
  MappedBytes bytes = MappedBytes.mappedBytes(file, 4 << 20);
  bytes.readLimit(bytes.realCapacity());
origin: OpenHFT/Chronicle-Queue

try {
  mappedBytes.readPosition(0);
  mappedBytes.readLimit(mappedBytes.realCapacity());
  while (mappedWire.readDataHeader()) {
    int header = mappedBytes.readVolatileInt();
origin: net.openhft/chronicle-bytes

@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;
}
origin: net.openhft/chronicle-bytes

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;
  }
}
origin: net.openhft/chronicle-queue

@NotNull
@Override
public String dump() {
  MappedBytes bytes = MappedBytes.mappedBytes(mappedFile);
  try {
    bytes.readLimit(bytes.realCapacity());
    return Wires.fromSizePrefixedBlobs(bytes);
  } finally {
    bytes.release();
  }
}
origin: net.openhft/chronicle-queue

@NotNull
@Override
public String dump() {
  MappedBytes bytes = MappedBytes.mappedBytes(mappedFile);
  try {
    bytes.readLimit(bytes.realCapacity());
    return Wires.fromSizePrefixedBlobs(bytes);
  } finally {
    bytes.release();
  }
}
origin: net.openhft/chronicle-bytes

@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);
}
origin: net.openhft/chronicle-queue

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);
origin: net.openhft/chronicle-queue

try {
  mappedBytes.readPosition(0);
  mappedBytes.readLimit(mappedBytes.realCapacity());
  while (mappedWire.readDataHeader()) {
    int header = mappedBytes.readVolatileInt();
net.openhft.chronicle.bytesMappedBytesreadLimit

Popular methods of MappedBytes

  • mappedBytes
  • addressForWrite
  • readPosition
  • release
  • reserve
  • writePosition
  • writeSkip
  • mappedFile
  • readRemaining
  • realCapacity
  • start
  • writeLimit
  • start,
  • writeLimit,
  • writeLong,
  • <init>,
  • acquireNextByteStore,
  • acquireNextByteStore0,
  • append8bit0,
  • appendUtf8,
  • bytesStore

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JButton (javax.swing)
  • JFileChooser (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now