Interface ByteArray

All Superinterfaces:
org.apache.lucene.util.Accountable, AutoCloseable, BigArray, Closeable, org.elasticsearch.core.Releasable

public interface ByteArray extends BigArray
Abstraction of an array of byte values.
  • Field Summary

    Fields inherited from interface org.apache.lucene.util.Accountable

    NULL_ACCOUNTABLE
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Get backing byte array analogous to ByteBuffer.array().
    void
    fill(long fromIndex, long toIndex, byte value)
    Fill slots between fromIndex inclusive to toIndex exclusive with value.
    byte
    get(long index)
    Get an element given its index.
    boolean
    get(long index, int len, org.apache.lucene.util.BytesRef ref)
    Get a reference to a slice.
    boolean
    Checks if this instance is backed by a single byte array analogous to ByteBuffer.hasArray().
    byte
    set(long index, byte value)
    Set a value at the given index and return the previous value.
    void
    set(long index, byte[] buf, int offset, int len)
    Bulk set.

    Methods inherited from interface org.apache.lucene.util.Accountable

    getChildResources, ramBytesUsed

    Methods inherited from interface org.elasticsearch.common.util.BigArray

    size

    Methods inherited from interface org.elasticsearch.core.Releasable

    close
  • Method Details

    • get

      byte get(long index)
      Get an element given its index.
    • set

      byte set(long index, byte value)
      Set a value at the given index and return the previous value.
    • get

      boolean get(long index, int len, org.apache.lucene.util.BytesRef ref)
      Get a reference to a slice.
      Returns:
      true when a byte[] was materialized, false otherwise.
    • set

      void set(long index, byte[] buf, int offset, int len)
      Bulk set.
    • fill

      void fill(long fromIndex, long toIndex, byte value)
      Fill slots between fromIndex inclusive to toIndex exclusive with value.
    • hasArray

      boolean hasArray()
      Checks if this instance is backed by a single byte array analogous to ByteBuffer.hasArray().
    • array

      byte[] array()
      Get backing byte array analogous to ByteBuffer.array().