|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BytesReference
A reference to bytes.
Method Summary | |
---|---|
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. |
byte |
get(int index)
Returns the byte at the specified index. |
boolean |
hasArray()
Is there an underlying byte array for this bytes reference. |
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. |
Method Detail |
---|
byte get(int index)
int length()
BytesReference slice(int from, int length)
StreamInput streamInput()
void writeTo(OutputStream os) throws IOException
IOException
byte[] toBytes()
BytesArray toBytesArray()
BytesArray copyBytesArray()
org.jboss.netty.buffer.ChannelBuffer toChannelBuffer()
boolean hasArray()
byte[] array()
int arrayOffset()
String toUtf8()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |