Package org.elasticsearch.common.bytes
Class PagedBytesReference
java.lang.Object
org.elasticsearch.common.bytes.AbstractBytesReference
org.elasticsearch.common.bytes.PagedBytesReference
- All Implemented Interfaces:
java.lang.Comparable<BytesReference>,BytesReference,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
public class PagedBytesReference extends AbstractBytesReference
A page based bytes reference, internally holding the bytes in a paged
data structure.
-
Nested Class Summary
-
Field Summary
-
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.AbstractBytesReference
compareTo, equals, getInt, hashCode, indexOf, streamInput, toXContent, utf8ToString, writeTo
-
Method Details
-
get
public byte get(int index)Description copied from interface:BytesReferenceReturns the byte at the specified index. Need to be between 0 and length. -
length
public int length()Description copied from interface:BytesReferenceThe length. -
slice
Description copied from interface:BytesReferenceSlice the bytes from thefromindex up tolength. -
toBytesRef
public org.apache.lucene.util.BytesRef toBytesRef()Description copied from interface:BytesReferenceConverts to Lucene BytesRef. -
iterator
public final org.apache.lucene.util.BytesRefIterator iterator()Description copied from interface:BytesReferenceReturns a BytesRefIterator for this BytesReference. This method allows access to the internal pages of this reference without copying them. Use with care!- Specified by:
iteratorin interfaceBytesReference- Overrides:
iteratorin classAbstractBytesReference- See Also:
BytesRefIterator
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:BytesReferenceThe amount of memory used by this BytesReference
-