ist.palcom.rascal
Class RascalMessage
java.lang.Object
ist.palcom.rascal.RascalMessage
public class RascalMessage
- extends java.lang.Object
Envelop of a PalCom message which includes the URN/URL/Selectors
of the receiver/sender.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RascalMessage
public RascalMessage(URN urn,
Message msg)
getTotalLength
public int getTotalLength()
write
public int write(byte[] buffer,
int offset)
- Write the RASCAL message to a buffer, starting at index offset.
- Returns:
- The number of bytes written.
- Throws:
java.lang.IndexOutOfBoundsException - if the buffer is too small.
parse
public static RascalMessage parse(byte[] data,
int offset,
int length)
- Factory method for parsing a Rascal Message from a byte array. The parsing
starts at offset and parses to the end of a message, or at most length
bytes.
- Returns:
- The message read, or null if no message could be read.
getMessage
public Message getMessage()
getURN
public URN getURN()