Tabnine Logo
ByteBlockPool.allocSlice
Code IndexAdd Tabnine to your IDE (free)

How to use
allocSlice
method
in
org.apache.lucene.util.ByteBlockPool

Best Java code snippets using org.apache.lucene.util.ByteBlockPool.allocSlice (Showing top 12 results out of 315)

origin: org.apache.lucene/lucene-core

/** Write byte into byte slice stream */
@Override
public void writeByte(byte b) {
 assert slice != null;
 if (slice[upto] != 0) {
  upto = pool.allocSlice(slice, upto);
  slice = pool.buffer;
  offset0 = pool.byteOffset;
  assert slice != null;
 }
 slice[upto++] = b;
 assert upto != slice.length;
}
origin: org.apache.lucene/lucene-core

void writeByte(int stream, byte b) {
 int upto = intUptos[intUptoStart+stream];
 byte[] bytes = bytePool.buffers[upto >> ByteBlockPool.BYTE_BLOCK_SHIFT];
 assert bytes != null;
 int offset = upto & ByteBlockPool.BYTE_BLOCK_MASK;
 if (bytes[offset] != 0) {
  // End of slice; allocate a new one
  offset = bytePool.allocSlice(bytes, offset);
  bytes = bytePool.buffer;
  intUptos[intUptoStart+stream] = offset + bytePool.byteOffset;
 }
 bytes[offset] = b;
 (intUptos[intUptoStart+stream])++;
}
origin: org.apache.lucene/lucene-core

@Override
public void writeBytes(final byte[] b, int offset, final int len) {
 final int offsetEnd = offset + len;
 while(offset < offsetEnd) {
  if (slice[upto] != 0) {
   // End marker
   upto = pool.allocSlice(slice, upto);
   slice = pool.buffer;
   offset0 = pool.byteOffset;
  }
  slice[upto++] = b[offset++];
  assert upto != slice.length;
 }
}
origin: org.infinispan/infinispan-embedded-query

/** Write byte into byte slice stream */
@Override
public void writeByte(byte b) {
 assert slice != null;
 if (slice[upto] != 0) {
  upto = pool.allocSlice(slice, upto);
  slice = pool.buffer;
  offset0 = pool.byteOffset;
  assert slice != null;
 }
 slice[upto++] = b;
 assert upto != slice.length;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** Write byte into byte slice stream */
@Override
public void writeByte(byte b) {
 assert slice != null;
 if (slice[upto] != 0) {
  upto = pool.allocSlice(slice, upto);
  slice = pool.buffer;
  offset0 = pool.byteOffset;
  assert slice != null;
 }
 slice[upto++] = b;
 assert upto != slice.length;
}
origin: harbby/presto-connectors

/** Write byte into byte slice stream */
@Override
public void writeByte(byte b) {
 assert slice != null;
 if (slice[upto] != 0) {
  upto = pool.allocSlice(slice, upto);
  slice = pool.buffer;
  offset0 = pool.byteOffset;
  assert slice != null;
 }
 slice[upto++] = b;
 assert upto != slice.length;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

void writeByte(int stream, byte b) {
 int upto = intUptos[intUptoStart+stream];
 byte[] bytes = bytePool.buffers[upto >> ByteBlockPool.BYTE_BLOCK_SHIFT];
 assert bytes != null;
 int offset = upto & ByteBlockPool.BYTE_BLOCK_MASK;
 if (bytes[offset] != 0) {
  // End of slice; allocate a new one
  offset = bytePool.allocSlice(bytes, offset);
  bytes = bytePool.buffer;
  intUptos[intUptoStart+stream] = offset + bytePool.byteOffset;
 }
 bytes[offset] = b;
 (intUptos[intUptoStart+stream])++;
}
origin: org.infinispan/infinispan-embedded-query

@Override
public void writeBytes(final byte[] b, int offset, final int len) {
 final int offsetEnd = offset + len;
 while(offset < offsetEnd) {
  if (slice[upto] != 0) {
   // End marker
   upto = pool.allocSlice(slice, upto);
   slice = pool.buffer;
   offset0 = pool.byteOffset;
  }
  slice[upto++] = b[offset++];
  assert upto != slice.length;
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@Override
public void writeBytes(final byte[] b, int offset, final int len) {
 final int offsetEnd = offset + len;
 while(offset < offsetEnd) {
  if (slice[upto] != 0) {
   // End marker
   upto = pool.allocSlice(slice, upto);
   slice = pool.buffer;
   offset0 = pool.byteOffset;
  }
  slice[upto++] = b[offset++];
  assert upto != slice.length;
 }
}
origin: org.infinispan/infinispan-embedded-query

void writeByte(int stream, byte b) {
 int upto = intUptos[intUptoStart+stream];
 byte[] bytes = bytePool.buffers[upto >> ByteBlockPool.BYTE_BLOCK_SHIFT];
 assert bytes != null;
 int offset = upto & ByteBlockPool.BYTE_BLOCK_MASK;
 if (bytes[offset] != 0) {
  // End of slice; allocate a new one
  offset = bytePool.allocSlice(bytes, offset);
  bytes = bytePool.buffer;
  intUptos[intUptoStart+stream] = offset + bytePool.byteOffset;
 }
 bytes[offset] = b;
 (intUptos[intUptoStart+stream])++;
}
origin: harbby/presto-connectors

@Override
public void writeBytes(final byte[] b, int offset, final int len) {
 final int offsetEnd = offset + len;
 while(offset < offsetEnd) {
  if (slice[upto] != 0) {
   // End marker
   upto = pool.allocSlice(slice, upto);
   slice = pool.buffer;
   offset0 = pool.byteOffset;
  }
  slice[upto++] = b[offset++];
  assert upto != slice.length;
 }
}
origin: harbby/presto-connectors

void writeByte(int stream, byte b) {
 int upto = intUptos[intUptoStart+stream];
 byte[] bytes = bytePool.buffers[upto >> ByteBlockPool.BYTE_BLOCK_SHIFT];
 assert bytes != null;
 int offset = upto & ByteBlockPool.BYTE_BLOCK_MASK;
 if (bytes[offset] != 0) {
  // End of slice; allocate a new one
  offset = bytePool.allocSlice(bytes, offset);
  bytes = bytePool.buffer;
  intUptos[intUptoStart+stream] = offset + bytePool.byteOffset;
 }
 bytes[offset] = b;
 (intUptos[intUptoStart+stream])++;
}
org.apache.lucene.utilByteBlockPoolallocSlice

Javadoc

Creates a new byte slice with the given starting size and returns the slices offset in the pool.

Popular methods of ByteBlockPool

  • <init>
  • reset
    Expert: Resets the pool to its initial state reusing the first buffer. Calling ByteBlockPool#nextBuf
  • nextBuffer
    Advances the pool to its next buffer. This method should be called once after the constructor to ini
  • append
    Appends the bytes in the provided BytesRef at the current position.
  • newSlice
    Allocates a new slice with the given size.
  • readBytes
    Reads bytes bytes out of the pool starting at the given offset with the given length into the given
  • setBytesRef
    Fill the provided BytesRef with the bytes at the specified offset/length slice. This will avoid copy
  • readByte
    Read a single byte at the given offset.
  • setRawBytesRef
    Set the given BytesRef so that its content is equal to the ref.length bytes starting at offset. Most
  • copy
  • copyFrom
  • copyFrom

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Best plugins for Eclipse
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