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

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

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

origin: OpenHFT/Chronicle-Queue

long address = bytes.addressForWrite(bytes.writePosition());
long bstart = bytes.start();
long bcap = bytes.realCapacity();
long canWrite = bcap - (bytes.writePosition() - bstart);
long lengthCount = batchAppender.writeMessages(address, canWrite, writeCount);
bytes.writeSkip((int) lengthCount);
origin: OpenHFT/Chronicle-Queue

if (wire != null && writeCount > 0) {
  MappedBytes bytes = (MappedBytes) wire.bytes();
  long address = bytes.addressForWrite(bytes.writePosition());
  long bstart = bytes.start();
  long bcap = bytes.realCapacity();
  long canWrite = bcap - (bytes.writePosition() - bstart);
  long lengthCount = writeMessages(address, canWrite, writeCount);
  bytes.writeSkip((int) lengthCount);
origin: OpenHFT/Chronicle-Queue

mappedBytes.writePosition(mappedBytes.readPosition());
long pos = recovery.writeHeader(mappedWire, safeLength, timeoutMS, null, null);
LongValue longValue = wireType.newLongReference().get();
origin: net.openhft/chronicle-bytes

public long rawCopy(@NotNull BytesStore bytes, long offset, long length)
    throws BufferOverflowException, BufferUnderflowException {
  assert length < safeCopySize();
  this.acquireNextByteStore(writePosition(), false);
  long len = Math.min(writeRemaining(), Math.min(bytes.readRemaining(), length));
  if (len > 0) {
    OS.memory().copyMemory(bytes.addressForRead(offset), addressForWrite(writePosition()), len);
    uncheckedWritePosition(writePosition() + len);
  }
  return len;
}
origin: net.openhft/chronicle-bytes

@NotNull
@Override
public Bytes<Void> append8bit(@NotNull CharSequence cs, int start, int end)
    throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException,
    IndexOutOfBoundsException {
  assert singleThreadedAccess();
  // check the start.
  long pos = writePosition();
  writeCheckOffset(pos, 0);
  if (!(cs instanceof String) || pos + (end - start) * 3 + 5 >= safeLimit()) {
    return super.append8bit(cs, start, end);
  }
  return append8bit0((String) cs, start, end - start);
}
origin: net.openhft/chronicle-bytes

@Override
@NotNull
public MappedBytes write8bit(CharSequence s, int start, int length) {
  assert singleThreadedAccess();
  if (s == null) {
    writeStopBit(-1);
    return this;
  }
  // check the start.
  long pos = writePosition();
  writeCheckOffset(pos, 0);
  if (!(s instanceof String) || pos + length * 3 + 5 >= safeLimit()) {
    super.write8bit(s, start, length);
    return this;
  }
  writeStopBit(length);
  return append8bit0((String) s, start, length);
}
origin: net.openhft/chronicle-bytes

if (Jvm.isJava9Plus()) {
  byte[] bytes = extractBytes(s);
  long address = addressForWrite(writePosition());
  Memory memory = bytesStore().memory;
  int i = 0;
} else {
  char[] chars = extractChars(s);
  long address = addressForWrite(writePosition());
  Memory memory = bytesStore().memory;
  int i = 0;
origin: net.openhft/chronicle-queue

long address = bytes.addressForWrite(bytes.writePosition());
long bstart = bytes.start();
long bcap = bytes.realCapacity();
long canWrite = bcap - (bytes.writePosition() - bstart);
long lengthCount = batchAppender.writeMessages(address, canWrite, writeCount);
bytes.writeSkip((int) lengthCount);
origin: net.openhft/chronicle-bytes

assert singleThreadedAccess();
long pos = writePosition();
writeCheckOffset(pos, 0);
if (!(cs instanceof String) || pos + length * 3 + 5 >= safeLimit()) {
origin: net.openhft/chronicle-queue

mappedBytes.writePosition(mappedBytes.readPosition());
long pos = recovery.writeHeader(mappedWire, safeLength, timeoutMS, null, null);
LongValue longValue = wireType.newLongReference().get();
net.openhft.chronicle.bytesMappedByteswritePosition

Popular methods of MappedBytes

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

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for Android Studio
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