congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ByteBlockPool.copyFrom
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.lucene/lucene-spellchecker

/**
 * Returns the <i>n'th</i> element of this {@link BytesRefList}
 * @param spare a spare {@link BytesRef} instance
 * @param ord the elements ordinal to retrieve 
 * @return the <i>n'th</i> element of this {@link BytesRefList}
 */
public BytesRef get(BytesRef spare, int ord) {
 if (lastElement > ord) {
  spare.offset = offsets[ord];
  spare.length = ord == lastElement - 1 ? currentOffset - spare.offset
    : offsets[ord + 1] - spare.offset;
  pool.copyFrom(spare);
  return spare;
 }
 throw new IndexOutOfBoundsException("index " + ord
   + " must be less than the size: " + lastElement);
 
}

org.apache.lucene.utilByteBlockPoolcopyFrom

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
  • allocSlice
    Creates a new byte slice with the given starting size and returns the slices offset in the pool.
  • 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
  • copy

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Menu (java.awt)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 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