java.lang.Comparable<BytesReference>, org.apache.lucene.util.Accountable, ToXContent, ToXContentFragmentByteBufferReference, BytesArray, CompositeBytesReference, PagedBytesReferencepublic abstract class BytesReference extends java.lang.Object implements org.apache.lucene.util.Accountable, java.lang.Comparable<BytesReference>, ToXContentFragment
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsEMPTY_PARAMS| Constructor | Description |
|---|---|
BytesReference() |
| Modifier and Type | Method | Description |
|---|---|---|
static BytesReference |
bytes(XContentBuilder xContentBuilder) |
Convert an
XContentBuilder into a BytesReference. |
int |
compareTo(BytesReference other) |
|
boolean |
equals(java.lang.Object other) |
|
abstract byte |
get(int index) |
Returns the byte at the specified index.
|
int |
hashCode() |
|
org.apache.lucene.util.BytesRefIterator |
iterator() |
Returns a BytesRefIterator for this BytesReference.
|
abstract int |
length() |
The length.
|
abstract BytesReference |
slice(int from,
int length) |
Slice the bytes from the from index up to length.
|
StreamInput |
streamInput() |
A stream input of the bytes.
|
static byte[] |
toBytes(BytesReference reference) |
Returns a compact array from the given BytesReference.
|
abstract org.apache.lucene.util.BytesRef |
toBytesRef() |
Converts to Lucene BytesRef.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
java.lang.String |
utf8ToString() |
Interprets the referenced bytes as UTF8 bytes, returning the resulting string
|
void |
writeTo(java.io.OutputStream os) |
Writes the bytes directly to the output stream.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisFragmentpublic static BytesReference bytes(XContentBuilder xContentBuilder)
XContentBuilder into a BytesReference. This method closes the builder,
so no further fields may be added.public abstract byte get(int index)
public abstract int length()
public abstract BytesReference slice(int from, int length)
public StreamInput streamInput() throws java.io.IOException
java.io.IOExceptionpublic void writeTo(java.io.OutputStream os)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String utf8ToString()
public abstract org.apache.lucene.util.BytesRef toBytesRef()
public org.apache.lucene.util.BytesRefIterator iterator()
BytesRefIteratorpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static byte[] toBytes(BytesReference reference)
public int compareTo(BytesReference other)
compareTo in interface java.lang.Comparable<BytesReference>public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOException