Package org.elasticsearch.common.util
Interface ByteArray
- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,BigArray,Closeable,org.elasticsearch.core.Releasable
Abstraction of an array of byte values.
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionbyte[]array()Get backing byte array analogous toByteBuffer.array().voidfill(long fromIndex, long toIndex, byte value)Fill slots betweenfromIndexinclusive totoIndexexclusive withvalue.byteget(long index)Get an element given its index.booleanget(long index, int len, org.apache.lucene.util.BytesRef ref)Get a reference to a slice.booleanhasArray()Checks if this instance is backed by a single byte array analogous toByteBuffer.hasArray().byteset(long index, byte value)Set a value at the given index and return the previous value.voidset(long index, byte[] buf, int offset, int len)Bulk set.Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods 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:
truewhen a byte[] was materialized,falseotherwise.
-
set
void set(long index, byte[] buf, int offset, int len)Bulk set. -
fill
void fill(long fromIndex, long toIndex, byte value)Fill slots betweenfromIndexinclusive totoIndexexclusive withvalue. -
hasArray
boolean hasArray()Checks if this instance is backed by a single byte array analogous toByteBuffer.hasArray(). -
array
byte[] array()Get backing byte array analogous toByteBuffer.array().
-