|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.domain.DataPackage
peer2me.domain.TextPackage
This class represents a data package containing text that should be sent over the network.
Field Summary |
Fields inherited from class peer2me.domain.DataPackage |
FILE_PACKAGE, GROUP_SYNC_PACKAGE, log, TEXT_PACKAGE |
Constructor Summary | |
TextPackage()
Constructor used to create an empty TextPackage object to fill with the parseBytes() method |
|
TextPackage(Node sender,
java.lang.String[] recipients,
java.lang.String content)
Constructor |
Method Summary | |
java.lang.String |
getContent()
This method returns the text content of this TextPackage |
void |
parseBytes(byte[] data)
This method parses the content of the byte array (byte[]) back into a TextPackage object |
byte[] |
toSendableFormat()
This method transforms this text package into a byte array (byte[]) that is possible to send over a network stream |
Methods inherited from class peer2me.domain.DataPackage |
getRecipients, getSender, getType, setRecipients, setSender |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextPackage(Node sender, java.lang.String[] recipients, java.lang.String content)
sender
- A node object representing the sender noderecipients
- The addresses to the recipients of the text packagecontent
- The String to be sentpublic TextPackage()
Method Detail |
public java.lang.String getContent()
public byte[] toSendableFormat()
toSendableFormat
in class DataPackage
public void parseBytes(byte[] data)
parseBytes
in class DataPackage
data
- The byte[] containing the data representing the TextPackage object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |