- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,BigArray,Closeable,Releasable,Writeable
- All Known Implementing Classes:
ReleasableByteArray
Abstraction of an array of byte values.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
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.voidfillWith(InputStream in) Fills this ByteArray with bytes from the given input streambyteget(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().org.apache.lucene.util.BytesRefIteratoriterator()Returns a BytesRefIterator for this ByteArray.static ByteArrayreadFrom(StreamInput in) voidset(long index, byte value) Set a value at the given index.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
-
readFrom
- Throws:
IOException
-
get
byte get(long index) Get an element given its index. -
set
void set(long index, byte value) Set a value at the given index. -
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. -
fillWith
Fills this ByteArray with bytes from the given input stream- Throws:
IOException
-
iterator
org.apache.lucene.util.BytesRefIterator iterator()Returns a BytesRefIterator for this ByteArray. This method allows access to the internal pages of this reference without copying them. -
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().
-