|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessage.Payload
public class Payload
Data structure for the "payload" of a message. A Payload
consists of two parts: Information about its length (4 byte length header)
and the data it contains itself (e. g. data the user wants to send via the
cascade or an encrypted message for the cascade's next mix).
Contains a padding mechanism to pad bypassed data to a desired length.
Field Summary | |
---|---|
private byte[] |
bytePayload
Byte representation of this Payload . |
Constructor Summary | |
---|---|
Payload(byte[] bytePayload)
Constructs a new Payload with the submitted content (
bytePayload ). |
Method Summary | |
---|---|
byte[] |
getBytePayload()
Returns the byte representation of this Payload . |
static int |
getHeaderLength()
Returns the length of the header used by this class for any Payload (Used to calculate message sizes). |
byte[] |
getMessage()
Returns the message embedded in this Payload (without
padding). |
private int |
getMessageLength()
Returns the length of the message embedded in this Payload
(without padding). |
void |
setMessage(byte[] newMessage,
int desiredLength)
Sets the bytePayload of this Payload to the
bypassed value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private byte[] bytePayload
Payload
.
Constructor Detail |
---|
public Payload(byte[] bytePayload)
Payload
with the submitted content (
bytePayload
).
bytePayload
- Byte representation of this Payload.Method Detail |
---|
public byte[] getBytePayload()
Payload
.
Payload
.private int getMessageLength()
Payload
(without padding).
public byte[] getMessage()
Payload
(without
padding).
Payload
(without
padding).public void setMessage(byte[] newMessage, int desiredLength)
bytePayload
of this Payload
to the
bypassed value. Adds padding if necessary.
newMessage
- The message to be embedded in this
Payload
.desiredLength
- The desired length of this Payload
.public static int getHeaderLength()
Payload
(Used to calculate message sizes).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |