Package org.elasticsearch.common.bytes
Class CompositeBytesReference
java.lang.Object
org.elasticsearch.common.bytes.AbstractBytesReference
org.elasticsearch.common.bytes.CompositeBytesReference
- All Implemented Interfaces:
- Comparable<BytesReference>,- BytesReference,- org.elasticsearch.common.xcontent.ToXContent,- org.elasticsearch.common.xcontent.ToXContentFragment
A composite 
BytesReference that allows joining multiple bytes references
 into one without copying.
 Note, toBytesRef() will materialize all pages in this BytesReference.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContentorg.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
- 
Field SummaryFields inherited from interface org.elasticsearch.common.xcontent.ToXContentEMPTY_PARAMS
- 
Method SummaryModifier and TypeMethodDescriptionbyteget(int index)Returns the byte at the specified index.intindexOf(byte marker, int from)Finds the index of the first occurrence of the given marker between within the given bounds.org.apache.lucene.util.BytesRefIteratoriterator()Returns a BytesRefIterator for this BytesReference.intlength()The length.static BytesReferenceof(BytesReference... references)longThe amount of memory used by this BytesReferenceslice(int from, int length)Slice the bytes from thefromindex up tolength.org.apache.lucene.util.BytesRefConverts to Lucene BytesRef.voidwriteTo(OutputStream os)Writes the bytes directly to the output stream.Methods inherited from class org.elasticsearch.common.bytes.AbstractBytesReferencecompareTo, equals, getInt, hashCode, streamInput, toXContent, utf8ToStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.common.bytes.BytesReferencearray, arrayOffset, hasArrayMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragmentisFragment
- 
Method Details- 
of
- 
getpublic byte get(int index)Description copied from interface:BytesReferenceReturns the byte at the specified index. Need to be between 0 and length.
- 
indexOfpublic int indexOf(byte marker, int from)Description copied from interface:BytesReferenceFinds the index of the first occurrence of the given marker between within the given bounds.- Specified by:
- indexOfin interface- BytesReference
- Overrides:
- indexOfin class- AbstractBytesReference
- Parameters:
- marker- marker byte to search
- from- lower bound for the index to check (inclusive)
- Returns:
- first index of the marker or -1if not found
 
- 
lengthpublic int length()Description copied from interface:BytesReferenceThe length.
- 
sliceDescription copied from interface:BytesReferenceSlice the bytes from thefromindex up tolength.
- 
toBytesRefpublic org.apache.lucene.util.BytesRef toBytesRef()Description copied from interface:BytesReferenceConverts to Lucene BytesRef.
- 
iteratorpublic 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 interface- BytesReference
- Overrides:
- iteratorin class- AbstractBytesReference
- See Also:
- BytesRefIterator
 
- 
writeToDescription copied from interface:BytesReferenceWrites the bytes directly to the output stream.- Specified by:
- writeToin interface- BytesReference
- Overrides:
- writeToin class- AbstractBytesReference
- Throws:
- IOException
 
- 
ramBytesUsedpublic long ramBytesUsed()Description copied from interface:BytesReferenceThe amount of memory used by this BytesReference
 
-