|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.common.bytes.BytesArray
public class BytesArray
Field Summary | |
---|---|
static BytesArray |
EMPTY
|
Constructor Summary | |
---|---|
BytesArray(byte[] bytes)
|
|
BytesArray(byte[] bytes,
int offset,
int length)
|
|
BytesArray(String bytes)
|
Method Summary | |
---|---|
byte[] |
array()
The underlying byte array (if exists). |
int |
arrayOffset()
The offset into the underlying byte array. |
boolean |
bytesEquals(BytesArray other)
|
BytesArray |
copyBytesArray()
Returns the bytes copied over as a byte array. |
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. |
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.jboss.netty.buffer.ChannelBuffer |
toChannelBuffer()
Returns the bytes as a channel buffer. |
String |
toUtf8()
Converts to a string based on utf8. |
void |
writeTo(OutputStream os)
Writes the bytes directly to the output stream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BytesArray EMPTY
Constructor Detail |
---|
public BytesArray(String bytes)
public BytesArray(byte[] bytes)
public BytesArray(byte[] bytes, int offset, int length)
Method Detail |
---|
public byte get(int index)
BytesReference
get
in interface BytesReference
public int length()
BytesReference
length
in interface BytesReference
public BytesReference slice(int from, int length)
BytesReference
slice
in interface BytesReference
public StreamInput streamInput()
BytesReference
streamInput
in interface BytesReference
public void writeTo(OutputStream os) throws IOException
BytesReference
writeTo
in interface BytesReference
IOException
public byte[] toBytes()
BytesReference
toBytes
in interface BytesReference
public BytesArray toBytesArray()
BytesReference
toBytesArray
in interface BytesReference
public BytesArray copyBytesArray()
BytesReference
copyBytesArray
in interface BytesReference
public org.jboss.netty.buffer.ChannelBuffer toChannelBuffer()
BytesReference
toChannelBuffer
in interface BytesReference
public boolean hasArray()
BytesReference
hasArray
in interface BytesReference
public byte[] array()
BytesReference
array
in interface BytesReference
public int arrayOffset()
BytesReference
arrayOffset
in interface BytesReference
public String toUtf8()
BytesReference
toUtf8
in interface BytesReference
public boolean equals(Object obj)
equals
in class Object
public boolean bytesEquals(BytesArray other)
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |