Package org.elasticsearch.common.bytes
Class CompositeBytesReference
- java.lang.Object
-
- org.elasticsearch.common.bytes.BytesReference
-
- org.elasticsearch.common.bytes.CompositeBytesReference
-
- All Implemented Interfaces:
java.lang.Comparable<BytesReference>,ToXContent,ToXContentFragment
public final class CompositeBytesReference extends BytesReference
A compositeBytesReferencethat allows joining multiple bytes references into one without copying. Note,toBytesRef()will materialize all pages in this BytesReference.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description CompositeBytesReference(BytesReference... references)
-
Method Summary
Modifier and Type Method Description byteget(int index)Returns the byte at the specified index.org.apache.lucene.util.BytesRefIteratoriterator()Returns a BytesRefIterator for this BytesReference.intlength()The length.longramBytesUsed()The amount of memory used by this BytesReferenceBytesReferenceslice(int from, int length)Slice the bytes from thefromindex up tolength.org.apache.lucene.util.BytesReftoBytesRef()Converts to Lucene BytesRef.-
Methods inherited from class org.elasticsearch.common.bytes.BytesReference
bytes, compareTo, equals, hashCode, streamInput, toBytes, toXContent, utf8ToString, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
CompositeBytesReference
public CompositeBytesReference(BytesReference... references)
-
-
Method Detail
-
get
public byte get(int index)
Description copied from class:BytesReferenceReturns the byte at the specified index. Need to be between 0 and length.- Specified by:
getin classBytesReference
-
length
public int length()
Description copied from class:BytesReferenceThe length.- Specified by:
lengthin classBytesReference
-
slice
public BytesReference slice(int from, int length)
Description copied from class:BytesReferenceSlice the bytes from thefromindex up tolength.- Specified by:
slicein classBytesReference
-
toBytesRef
public org.apache.lucene.util.BytesRef toBytesRef()
Description copied from class:BytesReferenceConverts to Lucene BytesRef.- Specified by:
toBytesRefin classBytesReference
-
iterator
public org.apache.lucene.util.BytesRefIterator iterator()
Description copied from class:BytesReferenceReturns a BytesRefIterator for this BytesReference. This method allows access to the internal pages of this reference without copying them. Use with care!- Overrides:
iteratorin classBytesReference- See Also:
BytesRefIterator
-
ramBytesUsed
public long ramBytesUsed()
Description copied from class:BytesReferenceThe amount of memory used by this BytesReference- Specified by:
ramBytesUsedin classBytesReference
-
-