public abstract class BytesReference extends java.lang.Object implements org.apache.lucene.util.Accountable, java.lang.Comparable<BytesReference>
| Constructor and Description |
|---|
BytesReference() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
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>