|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjist.swans.misc.MessageBytes
public class MessageBytes
Implementation of Message
interface that carries
around byte arrays.
Field Summary | |
---|---|
protected byte[] |
data
Message (byte-array) payload. |
static byte[] |
EMPTY
empty byte array. |
protected int |
length
Data length within byte-array. |
protected int |
offset
Data offset within byte-array. |
Fields inherited from interface jist.swans.misc.Message |
---|
NULL |
Constructor Summary | |
---|---|
MessageBytes(byte[] data)
Create new message object. |
|
MessageBytes(byte[] data,
int offset,
int length)
Create new message object. |
|
MessageBytes(java.lang.String data)
Create a new message object. |
Method Summary | |
---|---|
byte[] |
getBytes()
Return message payload. |
void |
getBytes(byte[] msg,
int offset)
Store packet into byte array. |
int |
getLength()
Return length of data within array. |
int |
getOffset()
Return offset of data within array. |
int |
getSize()
Return packet size or Constants.ZERO_WIRE_SIZE. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte[] EMPTY
protected byte[] data
protected int offset
protected int length
Constructor Detail |
---|
public MessageBytes(byte[] data, int offset, int length)
data
- message payloadoffset
- offset index within data arraylength
- length of data within arraypublic MessageBytes(byte[] data)
data
- message payloadpublic MessageBytes(java.lang.String data)
data
- message pyaloadMethod Detail |
---|
public byte[] getBytes()
public int getOffset()
public int getLength()
public java.lang.String toString()
toString
in class java.lang.Object
public int getSize()
getSize
in interface Message
public void getBytes(byte[] msg, int offset)
getBytes
in interface Message
msg
- destination byte arrayoffset
- byte array starting offset
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |