Tabnine Logo
DirectBytes.positionAndSize
Code IndexAdd Tabnine to your IDE (free)

How to use
positionAndSize
method
in
net.openhft.lang.io.DirectBytes

Best Java code snippets using net.openhft.lang.io.DirectBytes.positionAndSize (Showing top 5 results out of 315)

origin: OpenHFT/Java-Lang

@Override
public T get(long index) {
  T t = acquire();
  Byteable byteable = (Byteable) t;
  DirectBytes bytes = (DirectBytes) byteable.bytes();
  bytes.positionAndSize(index * size, size);
  return t;
}
origin: net.openhft/lang

@Override
public T get(long index) {
  T t = acquire();
  Byteable byteable = (Byteable) t;
  DirectBytes bytes = (DirectBytes) byteable.bytes();
  bytes.positionAndSize(index * size, size);
  return t;
}
origin: OpenHFT/Java-Lang

@Override
public void get(long index, T element) {
  if (tClass.isInstance(element)) {
    DirectBytes bytes = (DirectBytes) ((Byteable) element).bytes();
    bytes.positionAndSize(index * size, size);
    return;
  }
  T t = acquire();
  DirectBytes bytes = (DirectBytes) ((Byteable) t).bytes();
  bytes.positionAndSize(index * size, size);
  ((Copyable) element).copyFrom(t);
  recycle(t);
}
origin: net.openhft/lang

@Override
public void get(long index, T element) {
  if (tClass.isInstance(element)) {
    DirectBytes bytes = (DirectBytes) ((Byteable) element).bytes();
    bytes.positionAndSize(index * size, size);
    return;
  }
  T t = acquire();
  DirectBytes bytes = (DirectBytes) ((Byteable) t).bytes();
  bytes.positionAndSize(index * size, size);
  ((Copyable) element).copyFrom(t);
  recycle(t);
}
origin: stackoverflow.com

 final DirectStore store = DirectStore.allocate(128L << 32); // give me 128 GB
final DirectBytes slice = store.createSlice();

// every record has say 128 bytes and a lock at the start so they can be locked individually
for(long l = 0; l < store.size(); l += 128) {
  slice.positionAndSize(l, 128);
  slice.busyLock(0L);
  // change something
  slive.writeLong(4L, l);
  slice.unlock(0L);
}

// when finished with the store
store.free(); // still no GCs.
net.openhft.lang.ioDirectBytespositionAndSize

Popular methods of DirectBytes

  • <init>
  • busyLock
  • readLong
  • setStartPositionAddress
  • skip
  • sliceAsByteBuffer
  • store
  • unlock

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JList (javax.swing)
  • Top plugins for WebStorm
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