Package org.elasticsearch.common.bytes
Class PagedBytesReference
- java.lang.Object
-
- org.elasticsearch.common.bytes.BytesReference
-
- org.elasticsearch.common.bytes.PagedBytesReference
-
- All Implemented Interfaces:
java.lang.Comparable<BytesReference>
,org.apache.lucene.util.Accountable
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
ReleasablePagedBytesReference
public class PagedBytesReference extends BytesReference
A page based bytes reference, internally holding the bytes in a paged data structure.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteArray
byteArray
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description PagedBytesReference(BigArrays bigarrays, ByteArray byteArray, int length)
PagedBytesReference(BigArrays bigarrays, ByteArray byteArray, int from, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
get(int index)
Returns the byte at the specified index.org.apache.lucene.util.BytesRefIterator
iterator()
Returns a BytesRefIterator for this BytesReference.int
length()
The length.long
ramBytesUsed()
BytesReference
slice(int from, int length)
Slice the bytes from thefrom
index up tolength
.org.apache.lucene.util.BytesRef
toBytesRef()
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
-
-
-
-
Field Detail
-
byteArray
protected final ByteArray byteArray
-
-
Method Detail
-
get
public byte get(int index)
Description copied from class:BytesReference
Returns the byte at the specified index. Need to be between 0 and length.- Specified by:
get
in classBytesReference
-
length
public int length()
Description copied from class:BytesReference
The length.- Specified by:
length
in classBytesReference
-
slice
public BytesReference slice(int from, int length)
Description copied from class:BytesReference
Slice the bytes from thefrom
index up tolength
.- Specified by:
slice
in classBytesReference
-
toBytesRef
public org.apache.lucene.util.BytesRef toBytesRef()
Description copied from class:BytesReference
Converts to Lucene BytesRef.- Specified by:
toBytesRef
in classBytesReference
-
iterator
public final org.apache.lucene.util.BytesRefIterator iterator()
Description copied from class:BytesReference
Returns a BytesRefIterator for this BytesReference. This method allows access to the internal pages of this reference without copying them. Use with care!- Overrides:
iterator
in classBytesReference
- See Also:
BytesRefIterator
-
ramBytesUsed
public long ramBytesUsed()
-
-