public class PagedBytesReference extends Object implements BytesReference
BytesReference.Helper| Modifier and Type | Field and Description |
|---|---|
protected org.elasticsearch.common.util.ByteArray |
bytearray |
| Constructor and Description |
|---|
PagedBytesReference(org.elasticsearch.common.util.BigArrays bigarrays,
org.elasticsearch.common.util.ByteArray bytearray,
int length) |
PagedBytesReference(org.elasticsearch.common.util.BigArrays bigarrays,
org.elasticsearch.common.util.ByteArray bytearray,
int from,
int length) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array()
The underlying byte array (if exists).
|
int |
arrayOffset()
The offset into the underlying byte array.
|
BytesArray |
copyBytesArray()
Returns the bytes copied over as a byte array.
|
org.apache.lucene.util.BytesRef |
copyBytesRef()
Converts to a copied Lucene BytesRef.
|
boolean |
equals(Object obj) |
byte |
get(int index)
Returns the byte at the specified index.
|
boolean |
hasArray()
Is there an underlying byte array for this bytes reference.
|
int |
hashCode() |
int |
length()
The length.
|
BytesReference |
slice(int from,
int length)
Slice the bytes from the from index up to length.
|
org.elasticsearch.common.io.stream.StreamInput |
streamInput()
A stream input of the bytes.
|
byte[] |
toBytes()
Returns the bytes as a single byte array.
|
BytesArray |
toBytesArray()
Returns the bytes as a byte array, possibly sharing the underlying byte buffer.
|
org.apache.lucene.util.BytesRef |
toBytesRef()
Converts to Lucene BytesRef.
|
org.jboss.netty.buffer.ChannelBuffer |
toChannelBuffer()
Returns the bytes as a channel buffer.
|
String |
toUtf8()
Converts to a string based on utf8.
|
void |
writeTo(GatheringByteChannel channel)
Writes the bytes directly to the channel.
|
void |
writeTo(OutputStream os)
Writes the bytes directly to the output stream.
|
protected final org.elasticsearch.common.util.ByteArray bytearray
public PagedBytesReference(org.elasticsearch.common.util.BigArrays bigarrays, org.elasticsearch.common.util.ByteArray bytearray, int length)
public PagedBytesReference(org.elasticsearch.common.util.BigArrays bigarrays, org.elasticsearch.common.util.ByteArray bytearray, int from, int length)
public byte get(int index)
BytesReferenceget in interface BytesReferencepublic int length()
BytesReferencelength in interface BytesReferencepublic BytesReference slice(int from, int length)
BytesReferenceslice in interface BytesReferencepublic org.elasticsearch.common.io.stream.StreamInput streamInput()
BytesReferencestreamInput in interface BytesReferencepublic void writeTo(OutputStream os) throws IOException
BytesReferencewriteTo in interface BytesReferenceIOExceptionpublic void writeTo(GatheringByteChannel channel) throws IOException
BytesReferencewriteTo in interface BytesReferenceIOExceptionpublic byte[] toBytes()
BytesReferencetoBytes in interface BytesReferencepublic BytesArray toBytesArray()
BytesReferencetoBytesArray in interface BytesReferencepublic BytesArray copyBytesArray()
BytesReferencecopyBytesArray in interface BytesReferencepublic org.jboss.netty.buffer.ChannelBuffer toChannelBuffer()
BytesReferencetoChannelBuffer in interface BytesReferencepublic boolean hasArray()
BytesReferencehasArray in interface BytesReferencepublic byte[] array()
BytesReferencearray in interface BytesReferencepublic int arrayOffset()
BytesReferencearrayOffset in interface BytesReferencepublic String toUtf8()
BytesReferencetoUtf8 in interface BytesReferencepublic org.apache.lucene.util.BytesRef toBytesRef()
BytesReferencetoBytesRef in interface BytesReferencepublic org.apache.lucene.util.BytesRef copyBytesRef()
BytesReferencecopyBytesRef in interface BytesReferenceCopyright © 2012–2014. All rights reserved.