java.lang.Object
org.elasticsearch.common.util.ReleasableByteArray
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,Writeable,BigArray,ByteArray,Releasable
-
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().voidclose()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.longvoidset(long index, byte value) Set a value at the given index.voidset(long index, byte[] buf, int offset, int len) Bulk set.longsize()Return the length of this array.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
size
public long size()Description copied from interface:BigArrayReturn the length of this array. -
get
public byte get(long index) Description copied from interface:ByteArrayGet an element given its index. -
get
public boolean get(long index, int len, org.apache.lucene.util.BytesRef ref) Description copied from interface:ByteArrayGet a reference to a slice. -
set
public void set(long index, byte value) Description copied from interface:ByteArraySet a value at the given index. -
set
public void set(long index, byte[] buf, int offset, int len) Description copied from interface:ByteArrayBulk set. -
fill
public void fill(long fromIndex, long toIndex, byte value) Description copied from interface:ByteArrayFill slots betweenfromIndexinclusive totoIndexexclusive withvalue. -
hasArray
public boolean hasArray()Description copied from interface:ByteArrayChecks if this instance is backed by a single byte array analogous toByteBuffer.hasArray(). -
array
public byte[] array()Description copied from interface:ByteArrayGet backing byte array analogous toByteBuffer.array(). -
iterator
public org.apache.lucene.util.BytesRefIterator iterator()Description copied from interface:ByteArrayReturns a BytesRefIterator for this ByteArray. This method allows access to the internal pages of this reference without copying them. -
fillWith
Description copied from interface:ByteArrayFills this ByteArray with bytes from the given input stream -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-